mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 12:39:43 +02:00
Bug fix
This commit is contained in:
parent
92bd8f51b9
commit
0e23946cf8
2 changed files with 8 additions and 2 deletions
|
@ -255,6 +255,12 @@ class DomainInformation(TimeStampedModel):
|
||||||
else:
|
else:
|
||||||
da_many_to_many_dict[field] = getattr(domain_application, field).all()
|
da_many_to_many_dict[field] = getattr(domain_application, field).all()
|
||||||
|
|
||||||
|
# This will not happen in normal code flow, but having some redundancy doesn't hurt.
|
||||||
|
# da_dict should not have "id" under any circumstances.
|
||||||
|
if "id" in da_dict:
|
||||||
|
logger.warning("create_from_da() -> Found attribute 'id' when trying to create")
|
||||||
|
da_dict.pop("id", None)
|
||||||
|
|
||||||
# Create a placeholder DomainInformation object
|
# Create a placeholder DomainInformation object
|
||||||
domain_info = DomainInformation(**da_dict)
|
domain_info = DomainInformation(**da_dict)
|
||||||
|
|
||||||
|
|
|
@ -180,8 +180,8 @@ class DomainHelper:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Get a list of the existing fields on model_1 and model_2
|
# Get a list of the existing fields on model_1 and model_2
|
||||||
model_1_fields = set(field.name for field in model_1._meta.get_fields() if field != "id")
|
model_1_fields = set(field.name for field in model_1._meta.get_fields() if field.name != "id")
|
||||||
model_2_fields = set(field.name for field in model_2._meta.get_fields() if field != "id")
|
model_2_fields = set(field.name for field in model_2._meta.get_fields() if field.name != "id")
|
||||||
|
|
||||||
# Get the fields that exist on both DomainApplication and DomainInformation
|
# Get the fields that exist on both DomainApplication and DomainInformation
|
||||||
common_fields = model_1_fields & model_2_fields
|
common_fields = model_1_fields & model_2_fields
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue