-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Account Activation cleanup #22468
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
Account Activation cleanup #22468
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,6 @@ | |
| url(r'^accounts/disable_account_ajax$', views.disable_account_ajax, name="disable_account_ajax"), | ||
| url(r'^accounts/manage_user_standing', views.manage_user_standing, name='manage_user_standing'), | ||
|
|
||
| url(r'^change_setting$', views.change_setting, name='change_setting'), | ||
|
||
| url(r'^change_email_settings$', views.change_email_settings, name='change_email_settings'), | ||
|
|
||
| url(r'^course_run/{}/refund_status$'.format(settings.COURSE_ID_PATTERN), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -331,35 +331,6 @@ def _send_email_change_requests_if_needed(data, user): | |
| ) | ||
|
|
||
|
|
||
| @helpers.intercept_errors(errors.UserAPIInternalError, ignore_errors=[errors.UserAPIRequestError]) | ||
| def activate_account(activation_key): | ||
| """Activate a user's account. | ||
|
|
||
| Args: | ||
| activation_key (unicode): The activation key the user received via email. | ||
|
|
||
| Returns: | ||
| None | ||
|
|
||
| Raises: | ||
| errors.UserNotAuthorized | ||
| errors.UserAPIInternalError: the operation failed due to an unexpected error. | ||
|
|
||
| """ | ||
| # TODO: Confirm this `activate_account` is only used for tests. If so, this should not be used for tests, and we | ||
| # should instead use the `activate_account` used for /activate. | ||
| set_custom_metric('user_api_activate_account', 'True') | ||
|
||
| if waffle().is_enabled(PREVENT_AUTH_USER_WRITES): | ||
| raise errors.UserAPIInternalError(SYSTEM_MAINTENANCE_MSG) | ||
| try: | ||
| registration = Registration.objects.get(activation_key=activation_key) | ||
| except Registration.DoesNotExist: | ||
| raise errors.UserNotAuthorized | ||
| else: | ||
| # This implicitly saves the registration | ||
| registration.activate() | ||
|
|
||
|
|
||
| def get_name_validation_error(name): | ||
| """Get the built-in validation error message for when | ||
| the user's real name is invalid in some way (we wonder how). | ||
|
|
||
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.
Note to Reviewers: I updated these tests in order to merge test functionality that was in
AccountActivationAndPasswordChangeTestinopenedx/core/djangoapps/user_api/accounts/tests/test_api.py.