Linting / test

This commit is contained in:
zandercymatics 2023-08-24 12:58:08 -06:00
parent 09c336c1da
commit dc0420998b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,6 @@
"""Permissions-related mixin classes."""
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.http import Http404
from registrar.models import DomainApplication, DomainInvitation
@ -61,9 +60,10 @@ class DomainPermission(PermissionsLoginMixin):
# that does not exist, for example,
# https://getgov-staging.app.cloud.gov/domain/73333,
# the page throws a 403 error, instead of a 404.
# This fixes that behaviour, but do we want it to throw a 403 instead?
# Basically, should this be logger.debug()?
raise Http404()
# Do we want it to throw a 404 instead?
# Basically, should this be Http404()?
logger.warning(f"Domain with PK {pk} does not exist")
return False
# Analysts may manage domains, when they are in these statuses:
valid_domain_statuses = [

View file

@ -47,8 +47,8 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
def log_analyst_form_actions(self, form_class_name, printable_object_info):
"""Generates a log for when key 'analyst_action' exists on the session.
Follows this format: f"{user_type} {self.request.user}
edited {form_class_name} in {printable_object_info}"
Follows this format: f"{user_type} {self.request.user}
edited {form_class_name} in {printable_object_info}"
"""
if "analyst_action" in self.request.session:
action = self.request.session["analyst_action"]