Skip to content

Commit

Permalink
Remove print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
therealslimhsiehdy committed Oct 7, 2024
1 parent b331011 commit 9c46384
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
5 changes: 0 additions & 5 deletions src/registrar/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2464,14 +2464,9 @@ def generic_org_type(self, obj):
generic_org_type.admin_order_field = "domain_info__generic_org_type" # type: ignore

def federal_agency(self, obj):
# Print the state of obj and obj.domain_info for troubleshooting
print(f"federal_agency method called for: {obj}")
if obj.domain_info:
print(f"Domain info exists: {obj.domain_info}")
print(f"Federal agency value: {obj.domain_info.federal_agency}")
return obj.domain_info.federal_agency
else:
print("Domain info does not exist")
return None

federal_agency.admin_order_field = "domain_info__federal_agency" # type: ignore
Expand Down
30 changes: 0 additions & 30 deletions src/registrar/forms/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,40 +527,10 @@ def __init__(self, *args, **kwargs):
if field_to_disable is not None:
DomainHelper.disable_field(self.fields[field_to_disable], disable_required=True)

# def save(self, commit=True):
# """Override the save() method of the BaseModelForm."""
# if self.has_changed():

# # This action should be blocked by the UI, as the text fields are readonly.
# # If they get past this point, we forbid it this way.
# # This could be malicious, so lets reserve information for the backend only.
# if self.is_federal and not self._field_unchanged("federal_agency"):
# raise ValueError("federal_agency cannot be modified when the generic_org_type is federal")
# elif self.is_tribal and not self._field_unchanged("organization_name"):
# raise ValueError("organization_name cannot be modified when the generic_org_type is tribal")

# super().save()

def save(self, commit=True):
"""Override the save() method of the BaseModelForm."""

# print("Save method called")
if self.has_changed():
# print("Form has changed")
# print("Generic org type:", self.instance.generic_org_type)
# print("Federal agency:", self.instance.federal_agency)

# address_fields = [
# "address_line1",
# "address_line2",
# "city",
# "state_territory",
# "zipcode",
# "urbanization",
# ]

# if any(field in self.changed_data for field in address_fields):
# print("Address fields have changed")

# This action should be blocked by the UI, as the text fields are readonly.
# If they get past this point, we forbid it this way.
Expand Down

0 comments on commit 9c46384

Please sign in to comment.