mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-13 06:28:24 +02:00
linting
This commit is contained in:
parent
df3f37bf40
commit
7602629dc5
3 changed files with 51 additions and 42 deletions
|
@ -20,7 +20,11 @@ from epplibwrapper.errors import ErrorCode, RegistryError
|
|||
from registrar.models.user_domain_role import UserDomainRole
|
||||
from waffle.admin import FlagAdmin
|
||||
from waffle.models import Sample, Switch
|
||||
from registrar.utility.admin_helpers import get_all_action_needed_reason_emails, get_action_needed_reason_default_email, get_field_links_as_list
|
||||
from registrar.utility.admin_helpers import (
|
||||
get_all_action_needed_reason_emails,
|
||||
get_action_needed_reason_default_email,
|
||||
get_field_links_as_list,
|
||||
)
|
||||
from registrar.models import Contact, Domain, DomainRequest, DraftDomain, User, Website, SeniorOfficial
|
||||
from registrar.utility.constants import BranchChoices
|
||||
from registrar.utility.errors import FSMDomainRequestError, FSMErrorCodes
|
||||
|
|
|
@ -335,6 +335,7 @@ def get_url_name(path):
|
|||
logger.error(f"No matching URL name found for path: {path}")
|
||||
return None
|
||||
|
||||
|
||||
def value_of_attribute(obj, attribute_name: str):
|
||||
"""Returns the value of getattr if the attribute isn't callable.
|
||||
If it is, execute the underlying function and return that result instead."""
|
||||
|
|
|
@ -41,8 +41,13 @@ def get_action_needed_reason_default_email(request, domain_request, action_neede
|
|||
|
||||
|
||||
def get_field_links_as_list(
|
||||
queryset, model_name, attribute_name=None, link_info_attribute=None, separator=None, msg_for_none="-",
|
||||
):
|
||||
queryset,
|
||||
model_name,
|
||||
attribute_name=None,
|
||||
link_info_attribute=None,
|
||||
separator=None,
|
||||
msg_for_none="-",
|
||||
):
|
||||
"""
|
||||
Generate HTML links for items in a queryset, using a specified attribute for link text.
|
||||
|
||||
|
@ -86,4 +91,3 @@ def get_field_links_as_list(
|
|||
else:
|
||||
links = "".join(links)
|
||||
return format_html(f'<ul class="add-list-reset">{links}</ul>') if links else msg_for_none
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue