Skip to content

Commit

Permalink
Merge pull request #1179 from GSA/notify-compliance-46
Browse files Browse the repository at this point in the history
add new api for compliance #46
  • Loading branch information
ccostino authored Jul 12, 2024
2 parents a122542 + 337c90b commit a14efec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/user/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@ def activate_user(user_id):
return jsonify(data=user.serialize()), 200


@user_blueprint.route("/<uuid:user_id>/deactivate", methods=["POST"])
def deactivate_user(user_id):
user = get_user_by_id(user_id=user_id)
if user.state == "pending":
raise InvalidRequest("User already inactive", status_code=400)

user.state = "pending"
save_model_user(user)
return jsonify(data=user.serialize()), 200


@user_blueprint.route("/<uuid:user_id>/reset-failed-login-count", methods=["POST"])
def user_reset_failed_login_count(user_id):
user_to_update = get_user_by_id(user_id=user_id)
Expand Down

0 comments on commit a14efec

Please sign in to comment.