def delete_user(id): user = User.get(id) if not user: return api_error('User not found', 404) if user.id == current_user.id: return api_error('Cannot delete self', 404) user.delete() return '', 202
def delete_user(user_id): user = User.get(user_id) if not user: return form_error('User not found') if user.id == current_user.id: return form_error('Cannot delete self') user.delete() return '', 202
def load_user(user_id): return User.get(user_id)
def get_user(user_id): return jsonify(UserAdministrationResource(User.get(user_id)))