From ac2323b857a276e46c83167f3bbf1a0a6677a4e7 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 10 Sep 2013 19:33:39 +0200 Subject: [PATCH] forms: do not clobber the user_qs keyword argument fixes #3572 --- docbow_project/docbow/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docbow_project/docbow/forms.py b/docbow_project/docbow/forms.py index ecc98c3..4299a33 100644 --- a/docbow_project/docbow/forms.py +++ b/docbow_project/docbow/forms.py @@ -40,8 +40,9 @@ class RecipientForm(object): def __init__(self, *args, **kwargs): user = kwargs.pop('user', None) self.user = user - user_qs = kwargs.pop('user_qs', User.objects.filter()) - user_qs = non_guest_users().filter(is_active=True) + user_qs = kwargs.pop('user_qs', None) + if user_qs is None: + user_qs = non_guest_users().filter(is_active=True) list_qs = kwargs.pop('list_qs', MailingList.objects.active()) super(RecipientForm, self).__init__(*args, **kwargs) self.fields['recipients'].user = user