mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 03:58:39 +02:00
Update domain_request.py
This commit is contained in:
parent
9cb3ecebf4
commit
3d6d9b0d2f
1 changed files with 10 additions and 0 deletions
|
@ -673,6 +673,16 @@ class DomainRequest(TimeStampedModel):
|
||||||
self._cache_status_and_status_reasons()
|
self._cache_status_and_status_reasons()
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
"""
|
||||||
|
Validates suborganization-related fields in two scenarios:
|
||||||
|
1. New suborganization request: Prevents duplicate names within same portfolio
|
||||||
|
2. Partial suborganization data: Enforces a all-or-nothing rule for city/state/name fields
|
||||||
|
when portfolio exists without selected suborganization
|
||||||
|
|
||||||
|
Add new domain request validation rules here to ensure they're
|
||||||
|
enforced during both model save and form submission.
|
||||||
|
Not presently used on the domain request wizard, though.
|
||||||
|
"""
|
||||||
super().clean()
|
super().clean()
|
||||||
# Validation logic for a suborganization request
|
# Validation logic for a suborganization request
|
||||||
if self.is_requesting_new_suborganization():
|
if self.is_requesting_new_suborganization():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue