Added extra check for reset password (#745)

This commit is contained in:
farhatahmad 2019-08-15 13:20:55 -04:00 committed by Jesus Federico
parent 589536b18d
commit ea8acaff4c
1 changed files with 4 additions and 2 deletions

View File

@ -130,7 +130,9 @@ module ApplicationHelper
end
def can_reset_password
# Check if admin is editting user
Rails.application.routes.recognize_path(request.env['PATH_INFO'])[:action] == "edit_user"
# Check if admin is editting user and user is a greenlight account
Rails.configuration.enable_email_verification &&
Rails.application.routes.recognize_path(request.env['PATH_INFO'])[:action] == "edit_user" &&
@user.greenlight_account?
end
end