Code Room
Code reviewMedium
Question
Review this Python (SQLAlchemy) signup handler that enforces unique emails.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
def register(session, email, pw_hash): existing = session.query(User).filter_by(email=email).first() if existing: raise EmailTaken(email) user = User(email=email, pw_hash=pw_hash) session.add(user) session.commit() return userRun or narrate your approach, then ask the coach.