mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
linted
This commit is contained in:
parent
2a90335499
commit
1dfc68ce47
5 changed files with 14 additions and 19 deletions
|
@ -2490,12 +2490,11 @@ class PortfolioAdmin(ListHeaderAdmin):
|
||||||
is_federal = obj.organization_type == DomainRequest.OrganizationChoices.FEDERAL
|
is_federal = obj.organization_type == DomainRequest.OrganizationChoices.FEDERAL
|
||||||
if is_federal:
|
if is_federal:
|
||||||
obj.organization_name = obj.organization_type
|
obj.organization_name = obj.organization_type
|
||||||
#NOTE: What is meant by "federal agency text name?"
|
# NOTE: What is meant by "federal agency text name?"
|
||||||
|
|
||||||
super().save_model(request, obj, form, change)
|
super().save_model(request, obj, form, change)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FederalAgencyAdmin(ListHeaderAdmin):
|
class FederalAgencyAdmin(ListHeaderAdmin):
|
||||||
list_display = ["agency"]
|
list_display = ["agency"]
|
||||||
search_fields = ["agency"]
|
search_fields = ["agency"]
|
||||||
|
|
|
@ -37,7 +37,7 @@ __all__ = [
|
||||||
"TransitionDomain",
|
"TransitionDomain",
|
||||||
"VerifiedByStaff",
|
"VerifiedByStaff",
|
||||||
"WaffleFlag",
|
"WaffleFlag",
|
||||||
"Portfolio"
|
"Portfolio",
|
||||||
]
|
]
|
||||||
|
|
||||||
auditlog.register(Contact)
|
auditlog.register(Contact)
|
||||||
|
|
|
@ -57,7 +57,6 @@ class DomainInformation(TimeStampedModel):
|
||||||
help_text="Person who submitted the domain request",
|
help_text="Person who submitted the domain request",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# portfolio
|
# portfolio
|
||||||
portfolio = models.OneToOneField(
|
portfolio = models.OneToOneField(
|
||||||
"registrar.Portfolio",
|
"registrar.Portfolio",
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django_fsm import FSMField # type: ignore
|
|
||||||
|
|
||||||
from registrar.models.domain_request import DomainRequest
|
from registrar.models.domain_request import DomainRequest
|
||||||
from registrar.models.federal_agency import FederalAgency
|
from registrar.models.federal_agency import FederalAgency
|
||||||
|
|
||||||
from .utility.time_stamped_model import TimeStampedModel
|
from .utility.time_stamped_model import TimeStampedModel
|
||||||
|
|
||||||
|
|
||||||
def get_default_federal_agency():
|
def get_default_federal_agency():
|
||||||
"""returns non-federal agency"""
|
"""returns non-federal agency"""
|
||||||
return FederalAgency.objects.filter(agency="Non-Federal Agency").first()
|
return FederalAgency.objects.filter(agency="Non-Federal Agency").first()
|
||||||
|
|
||||||
|
|
||||||
class Portfolio(TimeStampedModel):
|
class Portfolio(TimeStampedModel):
|
||||||
"""
|
"""
|
||||||
Portfolio is used for organizing domains/domain-requests into
|
Portfolio is used for organizing domains/domain-requests into
|
||||||
|
@ -22,12 +23,7 @@ class Portfolio(TimeStampedModel):
|
||||||
|
|
||||||
# creator- user foreign key- stores who created this model should get the user who is adding
|
# creator- user foreign key- stores who created this model should get the user who is adding
|
||||||
# it via django admin if there is a user (aka not done via commandline/ manual means)"""
|
# it via django admin if there is a user (aka not done via commandline/ manual means)"""
|
||||||
creator = models.ForeignKey(
|
creator = models.ForeignKey("registrar.User", on_delete=models.PROTECT, help_text="Associated user", unique=False)
|
||||||
"registrar.User",
|
|
||||||
on_delete=models.PROTECT,
|
|
||||||
help_text="Associated user",
|
|
||||||
unique=False
|
|
||||||
)
|
|
||||||
|
|
||||||
# notes- text field (copy what is done on requests/domains)
|
# notes- text field (copy what is done on requests/domains)
|
||||||
notes = models.TextField(
|
notes = models.TextField(
|
||||||
|
@ -35,13 +31,14 @@ class Portfolio(TimeStampedModel):
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# federal agency - FK to fed agency table (Not nullable, should default to the Non-federal agency value in the fed agency table)
|
# federal agency - FK to fed agency table (Not nullable, should default
|
||||||
|
# to the Non-federal agency value in the fed agency table)
|
||||||
federal_agency = models.ForeignKey(
|
federal_agency = models.ForeignKey(
|
||||||
"registrar.FederalAgency",
|
"registrar.FederalAgency",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
help_text="Associated federal agency",
|
help_text="Associated federal agency",
|
||||||
unique=False,
|
unique=False,
|
||||||
default=get_default_federal_agency
|
default=get_default_federal_agency,
|
||||||
)
|
)
|
||||||
|
|
||||||
# organization type- should match organization types allowed on domain info
|
# organization type- should match organization types allowed on domain info
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue