This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit cd9c637bca9a32e74f29ac03b6de6fc9a0b3e7c3 Author: Marcus Christie <[email protected]> AuthorDate: Fri May 10 10:32:02 2019 -0400 AIRAVATA-2925 Handle unverified account in forgot password --- django_airavata/apps/auth/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/django_airavata/apps/auth/views.py b/django_airavata/apps/auth/views.py index 72ddf9a..489e368 100644 --- a/django_airavata/apps/auth/views.py +++ b/django_airavata/apps/auth/views.py @@ -317,6 +317,16 @@ def forgot_password(request): username = form.cleaned_data['username'] user_exists = iam_admin_client.is_user_exist(username) if user_exists: + user_enabled = iam_admin_client.is_user_enabled(username) + if not user_enabled: + messages.error( + request, + "Please finish creating your account before " + "resetting your password. Provide your username " + "below and we will send you another email " + "verification link.") + return redirect( + reverse('django_airavata_auth:resend_email_link')) _create_and_send_password_reset_request_link( request, username) # Always display this message even if you doesn't exist. Don't
