mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
Fine tuning
This commit is contained in:
parent
5d68031dce
commit
4c3404b885
4 changed files with 40 additions and 4 deletions
|
@ -1233,7 +1233,7 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
search_help_text = "Search by domain."
|
search_help_text = "Search by domain."
|
||||||
|
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None, {"fields": ["portfolio", "creator", "submitter", "domain_request", "notes"]}),
|
(None, {"fields": ["portfolio", "sub_organization", "creator", "submitter", "domain_request", "notes"]}),
|
||||||
(".gov domain", {"fields": ["domain"]}),
|
(".gov domain", {"fields": ["domain"]}),
|
||||||
("Contacts", {"fields": ["authorizing_official", "other_contacts", "no_other_contacts_rationale"]}),
|
("Contacts", {"fields": ["authorizing_official", "other_contacts", "no_other_contacts_rationale"]}),
|
||||||
("Background info", {"fields": ["anything_else"]}),
|
("Background info", {"fields": ["anything_else"]}),
|
||||||
|
@ -1510,6 +1510,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
{
|
{
|
||||||
"fields": [
|
"fields": [
|
||||||
"portfolio",
|
"portfolio",
|
||||||
|
"sub_organization",
|
||||||
"status",
|
"status",
|
||||||
"rejection_reason",
|
"rejection_reason",
|
||||||
"action_needed_reason",
|
"action_needed_reason",
|
||||||
|
@ -2645,6 +2646,11 @@ class PortfolioAdmin(ListHeaderAdmin):
|
||||||
# readonly_fields = [
|
# readonly_fields = [
|
||||||
# "requestor",
|
# "requestor",
|
||||||
# ]
|
# ]
|
||||||
|
# Creates select2 fields (with search bars)
|
||||||
|
autocomplete_fields = [
|
||||||
|
"creator",
|
||||||
|
"federal_agency",
|
||||||
|
]
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
|
|
||||||
|
@ -2728,6 +2734,9 @@ class DomainGroupAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
|
|
||||||
class SuborganizationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
class SuborganizationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
list_display = ["name", "portfolio"]
|
list_display = ["name", "portfolio"]
|
||||||
|
autocomplete_fields = [
|
||||||
|
"portfolio",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
admin.site.unregister(LogEntry) # Unregister the default registration
|
admin.site.unregister(LogEntry) # Unregister the default registration
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 4.2.10 on 2024-06-26 15:34
|
# Generated by Django 4.2.10 on 2024-06-26 16:07
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
@ -47,6 +47,18 @@ class Migration(migrations.Migration):
|
||||||
to="registrar.portfolio",
|
to="registrar.portfolio",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="domainrequest",
|
||||||
|
name="approved_domain",
|
||||||
|
field=models.OneToOneField(
|
||||||
|
blank=True,
|
||||||
|
help_text="Domain associated with this request; will be blank until request is approved",
|
||||||
|
null=True,
|
||||||
|
on_delete=django.db.models.deletion.SET_NULL,
|
||||||
|
related_name="domain_request_approved_domain",
|
||||||
|
to="registrar.domain",
|
||||||
|
),
|
||||||
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name="domainrequest",
|
model_name="domainrequest",
|
||||||
name="portfolio",
|
name="portfolio",
|
||||||
|
@ -59,4 +71,15 @@ class Migration(migrations.Migration):
|
||||||
to="registrar.portfolio",
|
to="registrar.portfolio",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="domainrequest",
|
||||||
|
name="requested_domain",
|
||||||
|
field=models.OneToOneField(
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
on_delete=django.db.models.deletion.PROTECT,
|
||||||
|
related_name="domain_request_requested_domain",
|
||||||
|
to="registrar.draftdomain",
|
||||||
|
),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -370,6 +370,10 @@ class DomainInformation(TimeStampedModel):
|
||||||
# domain_request, if so short circuit the create
|
# domain_request, if so short circuit the create
|
||||||
existing_domain_info = cls.objects.filter(domain_request__id=domain_request.id).first()
|
existing_domain_info = cls.objects.filter(domain_request__id=domain_request.id).first()
|
||||||
if existing_domain_info:
|
if existing_domain_info:
|
||||||
|
logger.info(
|
||||||
|
f"create_from_da() -> Shortcircuting create on {existing_domain_info}. "
|
||||||
|
"This record already exists. No values updated!"
|
||||||
|
)
|
||||||
return existing_domain_info
|
return existing_domain_info
|
||||||
|
|
||||||
# Get the fields that exist on both DomainRequest and DomainInformation
|
# Get the fields that exist on both DomainRequest and DomainInformation
|
||||||
|
|
|
@ -449,7 +449,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Domain associated with this request; will be blank until request is approved",
|
help_text="Domain associated with this request; will be blank until request is approved",
|
||||||
related_name="domain_request",
|
related_name="domain_request_approved_domain",
|
||||||
on_delete=models.SET_NULL,
|
on_delete=models.SET_NULL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
"DraftDomain",
|
"DraftDomain",
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
related_name="domain_request",
|
related_name="domain_request_requested_domain",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue