Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark registration profile activated when confirming invited user #3248

Merged
merged 1 commit into from
May 22, 2018

Conversation

jwalgran
Copy link
Contributor

Overview

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.

Connects #3247

Notes

Before this fix, users who accepted invitations were unable to reset their passwords because of this code:

https://github.com/OpenTreeMap/otm-core/blob/2.21.0/opentreemap/registration_backend/views.py#L211-L212

Testing Instructions

  • Run ./scripts/debugserver.sh
  • Browse http://localhost:6060/create and make an instance named activation-test
  • Browse http://localhost:6060/activation-test/management/user-roles/
  • Click "Add User" and submit an email address that does not yet exist in the database.
  • An invitation email will be logged to the console. Open the link included in that email in a different browser or incognito window.
  • Fill out the registration form making sure to use the exact same email address associated with the invitation.
  • Submit the registration form and verify that you are successfully logged in.
  • Click logout, then browse http://localhost:6060/activation-test/. You should be prompted to log in.
  • Click "Reset my Password"
  • Submit the email address used to create the test user and verify that a password reset email is printed to the console.

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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 83.868% when pulling ea2f9fe on jcw/fix-invitation-activation into 7ea8b1f on develop.

Copy link
Contributor

@mmcfarland mmcfarland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset link was generated in the console.

@mmcfarland mmcfarland assigned jwalgran and unassigned mmcfarland May 22, 2018
@jwalgran jwalgran merged commit e817965 into develop May 22, 2018
@jwalgran jwalgran deleted the jcw/fix-invitation-activation branch May 22, 2018 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants