mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 10:07:04 +02:00
Model updates and cleanup of comments
This commit is contained in:
parent
2c96eebc6f
commit
42efc73722
5 changed files with 17 additions and 25 deletions
|
@ -2562,6 +2562,8 @@ class PortfolioAdmin(ListHeaderAdmin):
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
|
|
||||||
|
if not obj.creator is None:
|
||||||
# ---- update creator ----
|
# ---- update creator ----
|
||||||
# Set the creator field to the current admin user
|
# Set the creator field to the current admin user
|
||||||
obj.creator = request.user if request.user.is_authenticated else None
|
obj.creator = request.user if request.user.is_authenticated else None
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 4.2.10 on 2024-06-17 19:47
|
# Generated by Django 4.2.10 on 2024-06-18 03:19
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
@ -150,7 +150,7 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name="domaininformation",
|
model_name="domaininformation",
|
||||||
name="portfolio",
|
name="portfolio",
|
||||||
field=models.OneToOneField(
|
field=models.ForeignKey(
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Portfolio associated with this domain",
|
help_text="Portfolio associated with this domain",
|
||||||
null=True,
|
null=True,
|
||||||
|
@ -162,7 +162,7 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name="domainrequest",
|
model_name="domainrequest",
|
||||||
name="portfolio",
|
name="portfolio",
|
||||||
field=models.OneToOneField(
|
field=models.ForeignKey(
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Portfolio associated with this domain request",
|
help_text="Portfolio associated with this domain request",
|
||||||
null=True,
|
null=True,
|
||||||
|
|
|
@ -58,7 +58,7 @@ class DomainInformation(TimeStampedModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
# portfolio
|
# portfolio
|
||||||
portfolio = models.OneToOneField(
|
portfolio = models.ForeignKey(
|
||||||
"registrar.Portfolio",
|
"registrar.Portfolio",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
null=True,
|
null=True,
|
||||||
|
|
|
@ -304,7 +304,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
# portfolio
|
# portfolio
|
||||||
portfolio = models.OneToOneField(
|
portfolio = models.ForeignKey(
|
||||||
"registrar.Portfolio",
|
"registrar.Portfolio",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
null=True,
|
null=True,
|
||||||
|
|
|
@ -21,18 +21,15 @@ class Portfolio(TimeStampedModel):
|
||||||
OrganizationChoices = DomainRequest.OrganizationChoices
|
OrganizationChoices = DomainRequest.OrganizationChoices
|
||||||
StateTerritoryChoices = DomainRequest.StateTerritoryChoices
|
StateTerritoryChoices = DomainRequest.StateTerritoryChoices
|
||||||
|
|
||||||
# creator - stores who created this model. If no creator is specified in DJA,
|
# Stores who created this model. If no creator is specified in DJA,
|
||||||
# then the creator will default to the current request user"""
|
# then the creator will default to the current request user"""
|
||||||
creator = models.ForeignKey("registrar.User", on_delete=models.PROTECT, help_text="Associated user", unique=False)
|
creator = models.ForeignKey("registrar.User", on_delete=models.PROTECT, help_text="Associated user", unique=False)
|
||||||
|
|
||||||
# notes - text field (copies what is done on domain requests)
|
|
||||||
notes = models.TextField(
|
notes = models.TextField(
|
||||||
null=True,
|
null=True,
|
||||||
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 = models.ForeignKey(
|
federal_agency = models.ForeignKey(
|
||||||
"registrar.FederalAgency",
|
"registrar.FederalAgency",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
|
@ -41,7 +38,6 @@ class Portfolio(TimeStampedModel):
|
||||||
default=get_default_federal_agency,
|
default=get_default_federal_agency,
|
||||||
)
|
)
|
||||||
|
|
||||||
# organization type - should match organization types allowed on domain info
|
|
||||||
organization_type = models.CharField(
|
organization_type = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
choices=OrganizationChoices.choices,
|
choices=OrganizationChoices.choices,
|
||||||
|
@ -50,34 +46,29 @@ class Portfolio(TimeStampedModel):
|
||||||
help_text="Type of organization",
|
help_text="Type of organization",
|
||||||
)
|
)
|
||||||
|
|
||||||
# organization name
|
|
||||||
# NOTE: org name will be the same as federal agency, if it is federal,
|
|
||||||
# otherwise it will be the actual org name. If nothing is entered for
|
|
||||||
# org name and it is a federal organization, have this field fill with
|
|
||||||
# the federal agency text name.
|
|
||||||
organization_name = models.CharField(
|
organization_name = models.CharField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# address_line1
|
|
||||||
address_line1 = models.CharField(
|
address_line1 = models.CharField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
verbose_name="address line 1",
|
verbose_name="address line 1",
|
||||||
)
|
)
|
||||||
# address_line2
|
|
||||||
address_line2 = models.CharField(
|
address_line2 = models.CharField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
verbose_name="address line 2",
|
verbose_name="address line 2",
|
||||||
)
|
)
|
||||||
# city
|
|
||||||
city = models.CharField(
|
city = models.CharField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
# state (copied from domain_request.py -- imports enums from domain_request.py)
|
|
||||||
|
# (imports enums from domain_request.py)
|
||||||
state_territory = models.CharField(
|
state_territory = models.CharField(
|
||||||
max_length=2,
|
max_length=2,
|
||||||
choices=StateTerritoryChoices.choices,
|
choices=StateTerritoryChoices.choices,
|
||||||
|
@ -85,14 +76,14 @@ class Portfolio(TimeStampedModel):
|
||||||
blank=True,
|
blank=True,
|
||||||
verbose_name="state / territory",
|
verbose_name="state / territory",
|
||||||
)
|
)
|
||||||
# zipcode
|
|
||||||
zipcode = models.CharField(
|
zipcode = models.CharField(
|
||||||
max_length=10,
|
max_length=10,
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
verbose_name="zip code",
|
verbose_name="zip code",
|
||||||
)
|
)
|
||||||
# urbanization
|
|
||||||
urbanization = models.CharField(
|
urbanization = models.CharField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
@ -100,7 +91,6 @@ class Portfolio(TimeStampedModel):
|
||||||
verbose_name="urbanization",
|
verbose_name="urbanization",
|
||||||
)
|
)
|
||||||
|
|
||||||
# security_contact_email
|
|
||||||
security_contact_email = models.EmailField(
|
security_contact_email = models.EmailField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue