Пример #1
0
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
Пример #2
0
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
Пример #3
0
def load_user(user_id):
    return User.get(user_id)
Пример #4
0
def get_user(user_id):
    return jsonify(UserAdministrationResource(User.get(user_id)))