mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 03:58:39 +02:00
Linting
This commit is contained in:
parent
db8c363d43
commit
3268fa44db
1 changed files with 8 additions and 13 deletions
|
@ -1148,9 +1148,9 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
|
||||
original_is_approved_and_current_is_not = (
|
||||
original_obj.status == models.DomainApplication.ApplicationStatus.APPROVED,
|
||||
obj.status != models.DomainApplication.ApplicationStatus.APPROVED
|
||||
obj.status != models.DomainApplication.ApplicationStatus.APPROVED,
|
||||
)
|
||||
if (original_is_approved_and_current_is_not and not obj.domain_is_not_active()):
|
||||
if original_is_approved_and_current_is_not and not obj.domain_is_not_active():
|
||||
# If an admin tried to set an approved application to
|
||||
# another status and the related domain is already
|
||||
# active, shortcut the action and throw a friendly
|
||||
|
@ -1158,10 +1158,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
# shortcut or not as the rules are duplicated on the model,
|
||||
# but the error would be an ugly Django error screen.
|
||||
error_message = "This action is not permitted. The domain is already active."
|
||||
elif (
|
||||
obj.status == models.DomainApplication.ApplicationStatus.REJECTED
|
||||
and not obj.rejection_reason
|
||||
):
|
||||
elif obj.status == models.DomainApplication.ApplicationStatus.REJECTED and not obj.rejection_reason:
|
||||
# This condition should never be triggered.
|
||||
# The opposite of this condition is acceptable (rejected -> other status and rejection_reason)
|
||||
# because we clean up the rejection reason in the transition in the model.
|
||||
|
@ -1179,9 +1176,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
try:
|
||||
selected_method()
|
||||
except ApplicationStatusError as err:
|
||||
logger.warning(
|
||||
f"User error encountered when trying to change status: {err}"
|
||||
)
|
||||
logger.warning(f"An error encountered when trying to change status: {err}")
|
||||
error_message = err.message
|
||||
|
||||
if error_message is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue