Skip to content

Commit

Permalink
Merge pull request #3248 from OpenTreeMap/jcw/fix-invitation-activation
Browse files Browse the repository at this point in the history
Mark registration profile activated when confirming invited user
  • Loading branch information
jwalgran committed May 22, 2018
2 parents 7ea8b1f + ea2f9fe commit e817965
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions opentreemap/manage_treemap/views/user_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ def activate_user(sender, user, request, password=None, **kwargs):

user.is_active = True
user.save_with_user(user)
# The registration system uses both the `activated` field in
# addition to the `User.is_active` fields. Setting `User.is_active`
# to false after activation lets us disable an account and prevent
# the user from reactivating it. Because of this we must also
# update the `activated` field.
user.registrationprofile.activated = True
user.registrationprofile.save()

auser = authenticate(username=user.username,
password=password)
Expand Down

0 comments on commit e817965

Please sign in to comment.