From da3e5312ab0e0fa65d492af48eff79fbc012c6ad Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 26 Feb 2010 12:30:28 +0100 Subject: [PATCH] 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. --- pgweb/util/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgweb/util/helpers.py b/pgweb/util/helpers.py index 8a4e7315..07e70f85 100644 --- a/pgweb/util/helpers.py +++ b/pgweb/util/helpers.py @@ -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