mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 19:39:23 +02:00
model/migration fix
This commit is contained in:
parent
1cb6dda7fb
commit
87a9a3f9d6
4 changed files with 9 additions and 22 deletions
|
@ -1017,7 +1017,7 @@ class ContactAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
return super().changelist_view(request, extra_context=extra_context)
|
return super().changelist_view(request, extra_context=extra_context)
|
||||||
|
|
||||||
|
|
||||||
class SeniorOfficialAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
class SeniorOfficialAdmin(ListHeaderAdmin):
|
||||||
"""Custom Senior Official Admin class."""
|
"""Custom Senior Official Admin class."""
|
||||||
|
|
||||||
# NOTE: these are just placeholders. Not part of ACs (haven't been defined yet). Update in future tickets.
|
# NOTE: these are just placeholders. Not part of ACs (haven't been defined yet). Update in future tickets.
|
||||||
|
@ -1031,13 +1031,6 @@ class SeniorOfficialAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
# in autocomplete_fields for user
|
# in autocomplete_fields for user
|
||||||
ordering = ["first_name", "last_name"]
|
ordering = ["first_name", "last_name"]
|
||||||
|
|
||||||
fieldsets = [
|
|
||||||
(
|
|
||||||
None,
|
|
||||||
{"fields": ["first_name", "last_name", "title", "phone"]},
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class WebsiteResource(resources.ModelResource):
|
class WebsiteResource(resources.ModelResource):
|
||||||
"""defines how each field in the referenced model should be mapped to the corresponding fields in the
|
"""defines how each field in the referenced model should be mapped to the corresponding fields in the
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
# Generated by Django 4.2.10 on 2024-06-20 21:16
|
# Generated by Django 4.2.10 on 2024-06-21 19:26
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import phonenumber_field.modelfields
|
import phonenumber_field.modelfields
|
||||||
import registrar.models.federal_agency
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -27,13 +26,17 @@ class Migration(migrations.Migration):
|
||||||
phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None),
|
phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name="portfolio",
|
model_name="portfolio",
|
||||||
name="senior_official",
|
name="senior_official",
|
||||||
field=models.ForeignKey(
|
field=models.ForeignKey(
|
||||||
default=registrar.models.federal_agency.FederalAgency.get_non_federal_agency,
|
blank=True,
|
||||||
help_text="Associated senior official",
|
help_text="Associated senior official",
|
||||||
|
null=True,
|
||||||
on_delete=django.db.models.deletion.PROTECT,
|
on_delete=django.db.models.deletion.PROTECT,
|
||||||
to="registrar.seniorofficial",
|
to="registrar.seniorofficial",
|
||||||
),
|
),
|
||||||
|
|
|
@ -43,7 +43,8 @@ class Portfolio(TimeStampedModel):
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
help_text="Associated senior official",
|
help_text="Associated senior official",
|
||||||
unique=False,
|
unique=False,
|
||||||
default=FederalAgency.get_non_federal_agency,
|
null=True,
|
||||||
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
organization_type = models.CharField(
|
organization_type = models.CharField(
|
||||||
|
|
|
@ -11,16 +11,6 @@ class SeniorOfficial(TimeStampedModel):
|
||||||
managing Portfolios.
|
managing Portfolios.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class Meta:
|
|
||||||
"""Contains meta information about this class"""
|
|
||||||
|
|
||||||
# Placeholder for later tickets...
|
|
||||||
# indexes = [
|
|
||||||
# models.Index(fields=["user"]),
|
|
||||||
# models.Index(fields=["email"]),
|
|
||||||
# ]
|
|
||||||
|
|
||||||
|
|
||||||
first_name = models.CharField(
|
first_name = models.CharField(
|
||||||
null=False,
|
null=False,
|
||||||
blank=False,
|
blank=False,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue