diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-08-21 17:24:01 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-08-21 17:24:01 +0800 |
commit | 3c6909740c2b00c31a9b39b5ef8e0ce7f588f685 (patch) | |
tree | dcdc11d13cf3dd3c96c3861e8aa99f7d9388f34c | |
parent | 8e8be3bcc0db37a92e12fe3ee2a3351c7a6bbcd9 (diff) | |
download | patchwork-3c6909740c2b00c31a9b39b5ef8e0ce7f588f685.tar.bz2 patchwork-3c6909740c2b00c31a9b39b5ef8e0ce7f588f685.tar.xz |
Add project argument to set_patches
MultiplePatchForm needs a project, so pass one down.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | apps/patchwork/utils.py | 4 | ||||
-rw-r--r-- | apps/patchwork/views/__init__.py | 4 | ||||
-rw-r--r-- | apps/patchwork/views/patch.py | 3 | ||||
-rw-r--r-- | apps/patchwork/views/user.py | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/apps/patchwork/utils.py b/apps/patchwork/utils.py index 7cf88bc..72eff4f 100644 --- a/apps/patchwork/utils.py +++ b/apps/patchwork/utils.py @@ -130,9 +130,9 @@ def set_bundle(user, action, data, patches, context): return [] -def set_patches(user, action, data, patches, context): +def set_patches(user, project, action, data, patches, context): errors = [] - form = MultiplePatchForm(data = data) + form = MultiplePatchForm(project = project, data = data) try: project = Project.objects.get(id = data['project']) diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py index 2636d29..b5c19c2 100644 --- a/apps/patchwork/views/__init__.py +++ b/apps/patchwork/views/__init__.py @@ -54,8 +54,8 @@ def generic_list(request, project, view, pass ps.append(patch) - (errors, form) = set_patches(request.user, action, request.POST, \ - ps, context) + (errors, form) = set_patches(request.user, project, action, \ + request.POST, ps, context) if errors: context['errors'] = errors diff --git a/apps/patchwork/views/patch.py b/apps/patchwork/views/patch.py index d509e28..f20f25d 100644 --- a/apps/patchwork/views/patch.py +++ b/apps/patchwork/views/patch.py @@ -156,7 +156,8 @@ def list(request, project_id): pass ps.append(patch) - (errors, form) = set_patches(request.user, action, request.POST, ps) + (errors, form) = set_patches(request.user, project, action, \ + request.POST, ps) if errors: context['errors'] = errors diff --git a/apps/patchwork/views/user.py b/apps/patchwork/views/user.py index 59d01a5..0e14549 100644 --- a/apps/patchwork/views/user.py +++ b/apps/patchwork/views/user.py @@ -27,7 +27,7 @@ from patchwork.models import Project, Patch, Bundle, Person, \ RegistrationRequest, UserProfile, UserPersonConfirmation, State from patchwork.forms import RegisterForm, LoginForm, MultiplePatchForm, \ UserProfileForm, UserPersonLinkForm -from patchwork.utils import Order, get_patch_ids, set_patches +from patchwork.utils import Order, get_patch_ids from patchwork.filters import DelegateFilter from patchwork.paginator import Paginator from patchwork.views import generic_list |