mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 04:29:44 +02:00
Fix bug
This commit is contained in:
parent
fce679f417
commit
830cf667e7
2 changed files with 12 additions and 0 deletions
|
@ -325,6 +325,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
Subordinate hosts (something.your-domain.gov) MUST have IP addresses,
|
Subordinate hosts (something.your-domain.gov) MUST have IP addresses,
|
||||||
while non-subordinate hosts MUST NOT.
|
while non-subordinate hosts MUST NOT.
|
||||||
"""
|
"""
|
||||||
|
raise ValueError("test")
|
||||||
try:
|
try:
|
||||||
# attempt to retrieve hosts from registry and store in cache and db
|
# attempt to retrieve hosts from registry and store in cache and db
|
||||||
hosts = self._get_property("hosts")
|
hosts = self._get_property("hosts")
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import abc # abstract base class
|
import abc # abstract base class
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.views.generic import DetailView, DeleteView, TemplateView
|
from django.views.generic import DetailView, DeleteView, TemplateView
|
||||||
from registrar.models import Domain, DomainRequest, DomainInvitation
|
from registrar.models import Domain, DomainRequest, DomainInvitation
|
||||||
from registrar.models.user_domain_role import UserDomainRole
|
from registrar.models.user_domain_role import UserDomainRole
|
||||||
|
@ -31,6 +32,16 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
|
||||||
# variable name in template context for the model object
|
# variable name in template context for the model object
|
||||||
context_object_name = "domain"
|
context_object_name = "domain"
|
||||||
|
|
||||||
|
def dispatch(self, request, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Custom implementation of dispatch to ensure that 500 error pages (and others)
|
||||||
|
have access to the IS_PRODUCTION flag
|
||||||
|
"""
|
||||||
|
if "IS_PRODUCTION" not in request.session:
|
||||||
|
# Pass the production flag to the context
|
||||||
|
request.session["IS_PRODUCTION"] = settings.IS_PRODUCTION
|
||||||
|
return super().dispatch(request, *args, **kwargs)
|
||||||
|
|
||||||
# Adds context information for user permissions
|
# Adds context information for user permissions
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue