-
Notifications
You must be signed in to change notification settings - Fork 420
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
Enable admins to activate users #3015
Enable admins to activate users #3015
Conversation
👏 |
@@ -132,6 +133,11 @@ def is_activated(self): | |||
|
|||
return False | |||
|
|||
def activate(self, request): | |||
"""Activate the user by deleting any activation they have.""" | |||
request.db.delete(self.activation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably better done as:
session = sa.orm.object_session(self)
session.delete(self.activation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we need request
anyway to send the notification, but see below...
Looks good, although I don't think moving the triggering of the |
73e1617
to
71714a0
Compare
Add an "Activate" button next to users on the /admin/users page so that admins can activate user accounts. Some refactoring to avoid code duplication between activating by users clicking on an activation link and admins clicking the new activate button: move the code that actually activates the user onto the User model where both views can call it.
71714a0
to
cff6f6d
Compare
Ok, this is done again |
Looks fab. Sorry for the misunderstanding earlier! |
…-to-admin-users-page Enable admins to activate users
Add an "Activate" button next to users on the /admin/users page so that
admins can activate user accounts.
Some refactoring to avoid code duplication between activating by users
clicking on an activation link and admins clicking the new activate button:
move the code that actually activates the user onto the User model where
both views can call it.