Commit 3c690974 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

Add project argument to set_patches



MultiplePatchForm needs a project, so pass one down.
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent 8e8be3bc
......@@ -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'])
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment