Merge pull request #3636 from cisagov/rh/3576-phantom-domain-request

#3576: Phantom Domain Request - [RH]
This commit is contained in:
Slim 2025-03-17 09:02:10 -07:00 committed by GitHub
commit e557df2e94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 6 deletions

View file

@ -207,6 +207,17 @@ Linters:
docker-compose exec app ./manage.py lint
```
### Get availability for domain requests to work locally
If you're on local (localhost:8080) and want to submit a domain request, and keep getting the "Were experiencing a system error. Please wait a few minutes and try again. If you continue to get this error, contact help@get.gov." error, you can get past the availability check by updating the available() function in registrar/models/domain.py to return True and comment everything else out - see below for reference!
```
@classmethod
def available(cls, domain: str) -> bool:
# Comment everything else out in the function
return True
```
### Testing behind logged in pages
To test behind logged in pages with external tools, like `pa11y-ci` or `OWASP Zap`, add

View file

@ -86,7 +86,6 @@ class RequestingEntityForm(RegistrarForm):
return {}
# get the domain request as a dict, per usual method
domain_request_dict = {name: getattr(obj, name) for name in cls.declared_fields.keys()} # type: ignore
# set sub_organization to 'other' if is_requesting_new_suborganization is True
if isinstance(obj, DomainRequest) and obj.is_requesting_new_suborganization():
domain_request_dict["sub_organization"] = "other"

View file

@ -245,6 +245,7 @@ class Domain(TimeStampedModel, DomainHelper):
is called in the validate function on the request/domain page
throws- RegistryError or InvalidDomainError"""
if not cls.string_could_be_domain(domain):
logger.warning("Not a valid domain: %s" % str(domain))
# throw invalid domain error so that it can be caught in

View file

@ -227,7 +227,6 @@ class DomainRequestWizard(TemplateView):
creator=self.request.user,
portfolio=portfolio,
)
# Question for reviewers: we should probably be doing this right?
if portfolio and not self._domain_request.generic_org_type:
self._domain_request.generic_org_type = portfolio.organization_type
@ -598,7 +597,6 @@ class RequestingEntity(DomainRequestWizard):
"suborganization_state_territory": None,
}
)
super().save(forms)
@ -931,11 +929,9 @@ class Finished(DomainRequestWizard):
forms = [] # type: ignore
def get(self, request, *args, **kwargs):
context = self.get_context_data()
context["domain_request_id"] = self.domain_request.id
# clean up this wizard session, because we are done with it
del self.storage
return render(self.request, self.template_name, context)
return render(self.request, self.template_name)
@grant_access(IS_DOMAIN_REQUEST_CREATOR, HAS_PORTFOLIO_DOMAIN_REQUESTS_EDIT)