Skip to content

Commit

Permalink
add references to email self-update disabled when self-registration e…
Browse files Browse the repository at this point in the history
…nabled (#436)
  • Loading branch information
fmigneault committed Jun 29, 2021
1 parent 87d2905 commit fa182f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Features / Changes
* Add UI view to display pending user registration details.
* Add UI icon to indicate when a listed user is pending registration approval or email validation.
* Disable user email self-update (when not administrator) both on the API and UI side
whenever ``MAGPIE_USER_REGISTRATION_ENABLED`` was activated to avoid losing the confirmation of the original email.
whenever ``MAGPIE_USER_REGISTRATION_ENABLED`` was activated to avoid losing the confirmation of the original email
(see feature `#436 <https://github.com/Ouranosinc/Magpie/issues/436>`_).
* Add configuration setting ``MAGPIE_USER_REGISTRATION_ENABLED`` to control whether user account self-registration
feature should be employed.
With it comes multiple other ``MAGPIE_USER_REGISTRATION_<...>`` settings to customize notification emails.
Expand Down
1 change: 1 addition & 0 deletions magpie/api/management/user/user_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def update_user(user, request, new_user_name=None, new_password=None, new_email=
http_error=HTTPBadRequest, msg_on_fail=s.User_PATCH_BadRequestResponseSchema.description)

# FIXME: disable email edit when self-registration is enabled to avoid not having any confirmation of new email
# (see https://github.com/Ouranosinc/Magpie/issues/436)
update_email_admin_only = False
if update_email and asbool(get_constant("MAGPIE_USER_REGISTRATION_ENABLED", request)):
update_email_admin_only = True
Expand Down
1 change: 1 addition & 0 deletions magpie/ui/user/templates/edit_current_user.mako
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
</div>
%elif not user_edit_email:
<div class="panel-form-lock">
<!-- see https://github.com/Ouranosinc/Magpie/issues/436 -->
<img src="${request.static_url('magpie.ui.home:static/lock.png')}" alt="LOCKED"
class="icon-locked"/>
<meta name="author" content="https://www.flaticon.com/authors/those-icons">
Expand Down
1 change: 1 addition & 0 deletions magpie/ui/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def edit_current_user(self):
user_info["joined_groups"] = joined_groups
user_info["groups"] = public_groups
# FIXME: disable email edit when self-registration is enabled to avoid not having any confirmation of new email
# (see https://github.com/Ouranosinc/Magpie/issues/436)
user_info["user_edit_email"] = not asbool(get_constant("MAGPIE_USER_REGISTRATION_ENABLED", self.request))
user_info["user_with_error"] = schemas.UserStatuses.get(user_info["status"]) != schemas.UserStatuses.OK
# reset error messages/flags
Expand Down

0 comments on commit fa182f8

Please sign in to comment.