This commit is contained in:
CocoByte 2024-06-18 12:05:04 -06:00
parent 1f2d63070d
commit 46c2326933
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
3 changed files with 3 additions and 3 deletions

View file

@ -2563,7 +2563,7 @@ class PortfolioAdmin(ListHeaderAdmin):
def save_model(self, request, obj, form, change):
if not obj.creator is None:
if obj.creator is not None:
# ---- update creator ----
# Set the creator field to the current admin user
obj.creator = request.user if request.user.is_authenticated else None

View file

@ -234,4 +234,4 @@ class FederalAgency(TimeStampedModel):
@classmethod
def get_non_federal_agency(cls):
"""Returns the non-federal agency."""
return FederalAgency.objects.filter(agency="Non-Federal Agency").first()
return FederalAgency.objects.filter(agency="Non-Federal Agency").first()

View file

@ -20,7 +20,7 @@ class Portfolio(TimeStampedModel):
# use the short names in Django admin
OrganizationChoices = DomainRequest.OrganizationChoices
StateTerritoryChoices = DomainRequest.StateTerritoryChoices
# Stores who created this model. If no creator is specified in DJA,
# 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)