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.
This commit is contained in:
Magnus Hagander
2011-11-15 22:49:48 +01:00
parent 5c95c66db1
commit d604309ea9
2 changed files with 15 additions and 3 deletions

View File

@ -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: