Skip to content

Commit

Permalink
Merge pull request #49 from awgreenblatt/master
Browse files Browse the repository at this point in the history
Check for password_field is not None before attempting to set its hel…
  • Loading branch information
lefterisnik committed Aug 16, 2018
2 parents eabde31 + c3afbd1 commit 4089d78
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions admin_view_permission/admin.py
Expand Up @@ -363,15 +363,15 @@ def get_form(self, request, obj=None, **kwargs):
else:
password_field = None

# TODO: I don't like this at all. Find another way to change the
# TODO: help_text
if not self._has_change_only_permission(request):
password_field.help_text = _(
"Raw passwords are not stored, so there is no way to see this "
"user's password."
)
else:
if password_field:
if password_field:
# TODO: I don't like this at all. Find another way to change the
# TODO: help_text
if not self._has_change_only_permission(request):
password_field.help_text = _(
"Raw passwords are not stored, so there is no way to "
"see this user's password."
)
else:
password_field.help_text = _(
"Raw passwords are not stored, so there is no way to see "
"this user's password, but you can change the password "
Expand Down

0 comments on commit 4089d78

Please sign in to comment.