mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 19:09:22 +02:00
Linting
This commit is contained in:
parent
f5116315e8
commit
a8836d35aa
1 changed files with 4 additions and 5 deletions
|
@ -51,9 +51,9 @@ class MyUserAdminForm(UserChangeForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Custom init to modify the user form"""
|
"""Custom init to modify the user form"""
|
||||||
super(MyUserAdminForm, self).__init__(*args, **kwargs)
|
super(MyUserAdminForm, self).__init__(*args, **kwargs)
|
||||||
self.override_base_help_texts()
|
self._override_base_help_texts()
|
||||||
|
|
||||||
def override_base_help_texts(self):
|
def _override_base_help_texts(self):
|
||||||
"""
|
"""
|
||||||
Used to override pre-existing help texts in AbstractUser.
|
Used to override pre-existing help texts in AbstractUser.
|
||||||
This is done to avoid modifying the base AbstractUser class.
|
This is done to avoid modifying the base AbstractUser class.
|
||||||
|
@ -63,14 +63,13 @@ class MyUserAdminForm(UserChangeForm):
|
||||||
password = self.fields.get("password")
|
password = self.fields.get("password")
|
||||||
|
|
||||||
if is_superuser is not None:
|
if is_superuser is not None:
|
||||||
is_superuser.help_text = (
|
is_superuser.help_text = "For development purposes only; provides superuser access on the database level."
|
||||||
"For development purposes only; provides superuser access on the database level."
|
|
||||||
)
|
|
||||||
|
|
||||||
if is_staff is not None:
|
if is_staff is not None:
|
||||||
is_staff.help_text = "Designates whether the user can log in to this admin site."
|
is_staff.help_text = "Designates whether the user can log in to this admin site."
|
||||||
|
|
||||||
if password is not None:
|
if password is not None:
|
||||||
|
# Link is copied from the base implementation of UserChangeForm.
|
||||||
link = f"../../{self.instance.pk}/password/"
|
link = f"../../{self.instance.pk}/password/"
|
||||||
password.help_text = (
|
password.help_text = (
|
||||||
"Raw passwords are not stored, so they will not display here. "
|
"Raw passwords are not stored, so they will not display here. "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue