summaryrefslogtreecommitdiff
path: root/pgweb/util/helpers.py
diff options
context:
space:
mode:
authorMagnus Hagander2011-11-15 21:49:48 +0000
committerMagnus Hagander2011-11-15 21:49:48 +0000
commitd604309ea90624fe3a340c8dc4f96bf5db4fdfaa (patch)
tree3d139bd290fe55dcf2468f1d10e8914e83eedefa /pgweb/util/helpers.py
parent5c95c66db103fbdf3153763a7c14470dad359551 (diff)
Make sure the submitter is always listed as an organisation admin
This fixes organisation submitting again, and also makes it impossible to orphan oneself from an organisation.
Diffstat (limited to 'pgweb/util/helpers.py')
-rw-r--r--pgweb/util/helpers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pgweb/util/helpers.py b/pgweb/util/helpers.py
index dfcbb238..d62ea42f 100644
--- a/pgweb/util/helpers.py
+++ b/pgweb/util/helpers.py
@@ -26,6 +26,11 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
r.submitter = request.user
r.save()
+ # If we have a callback with the current user
+ if hasattr(form, 'apply_submitter'):
+ form.apply_submitter(r, request.user)
+ r.save()
+
# In case fixedfields include a manytomany field, we need to make sure the main form is saved first,
# so we can access the field without an exception.
if fixedfields: