mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 10:07:04 +02:00
added check if creator exists
This commit is contained in:
parent
46769cb8a6
commit
b5330e1c38
1 changed files with 5 additions and 2 deletions
|
@ -2866,7 +2866,10 @@ class PortfolioAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
|
|
||||||
obj.creator = request.user if request.user.is_authenticated else None
|
if hasattr(obj, 'creator') is False:
|
||||||
|
# ---- update creator ----
|
||||||
|
# Set the creator field to the current admin user
|
||||||
|
obj.creator = request.user if request.user.is_authenticated else None
|
||||||
# ---- update organization name ----
|
# ---- update organization name ----
|
||||||
# org name will be the same as federal agency, if it is federal,
|
# org name will be the same as federal agency, if it is federal,
|
||||||
# otherwise it will be the actual org name. If nothing is entered for
|
# otherwise it will be the actual org name. If nothing is entered for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue