Skip to content

Commit 26233bf

Browse files
stephenfinfstachura
authored andcommitted
views: Populate 'project' attribute of PatchForm
This is required to ensure we can filter delegates by project. If we don't do this, our <select> gets stupid long, as seen in commit 198139e.
1 parent 65c90ee commit 26233bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎patchwork/views/patch.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def patch_detail(request, project_id, msgid):
6767
errors = None
6868

6969
if editable:
70-
form = PatchForm(instance=patch)
70+
form = PatchForm(instance=patch, project=patch.project)
7171
if request.user.is_authenticated:
7272
create_bundle_form = CreateBundleForm()
7373

@@ -85,7 +85,9 @@ def patch_detail(request, project_id, msgid):
8585
return HttpResponseForbidden()
8686

8787
elif action == 'update':
88-
form = PatchForm(data=request.POST, instance=patch)
88+
form = PatchForm(
89+
data=request.POST, instance=patch, project=patch.project
90+
)
8991
if form.is_valid():
9092
form.save()
9193
messages.success(request, 'Patch updated')

0 commit comments

Comments
 (0)