Make filter_by_user apply to forms when they are edited as well, not just

when they are created. This is to make sure the organisation list, for example,
doesn't list all non-avaiable organisations when there was a missing field
somewhere else in the form.
This commit is contained in:
Magnus Hagander
2010-02-26 12:30:28 +01:00
parent 4af5285cb0
commit da3e5312ab

View File

@ -32,8 +32,9 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
else:
# Generate form
form = formclass(instance=instance)
if hasattr(form, 'filter_by_user'):
form.filter_by_user(request.user)
if hasattr(form, 'filter_by_user'):
form.filter_by_user(request.user)
if hasattr(instancetype, 'markdown_fields'):
markdownfields = instancetype.markdown_fields