Code Room
Code reviewHard
Question
Review this Python user-update endpoint that spreads the request body onto the model.
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
@app.put('/account')def update_account(): body = request.get_json() user = current_user() for key, value in body.items(): setattr(user, key, value) # apply all submitted fields db.session.commit() return jsonify(user.to_dict())Run or narrate your approach, then ask the coach.