Skip to content

Commit

Permalink
Update the username when authenticating user
Browse files Browse the repository at this point in the history
If the user with e-mail exists update his username.

Signed-off-by: Michal Konecny <[email protected]>
  • Loading branch information
Zlopez committed Dec 5, 2024
1 parent aa1aef3 commit 8109057
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions anitya/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def auth(name): # pragma: no cover
Session.add(new_user)
Session.commit()
user = new_user
elif user.username != user_info["username"]:
user.username = user_info["username"]
Session.add(user)
Session.commit()
_log.debug("Logging as user %s", user.email)
flask_login.login_user(user)

Expand Down

0 comments on commit 8109057

Please sign in to comment.