Skip to content

Commit b873af1

Browse files
committed
Merged in [16583] from rjsparks@nostrum.com:
Restore ability to remove documents while managing a personal list. Required updating code to match the recent change to Document's primary key. Fixes ietf-tools#2757. - Legacy-Id: 16608 Note: SVN reference [16583] has been migrated to Git commit 8216098
1 parent baa639b commit b873af1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ietf/community/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_manage_personal_list(self):
123123
self.assertContains(r, draft.name)
124124

125125
# remove document
126-
r = self.client.post(url, { "action": "remove_document", "document": draft.name })
126+
r = self.client.post(url, { "action": "remove_document", "document": draft.pk })
127127
self.assertEqual(r.status_code, 302)
128128
clist = CommunityList.objects.get(user__username="plain")
129129
self.assertTrue(not clist.added_docs.filter(pk=draft.pk))

ietf/community/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def manage_list(request, username=None, acronym=None, group_type=None):
6767
add_doc_form = AddDocumentsForm()
6868

6969
if request.method == 'POST' and action == 'remove_document':
70-
document_name = request.POST.get('document')
71-
if clist.pk is not None and document_name:
72-
document = get_object_or_404(clist.added_docs, name=document_name)
70+
document_id = request.POST.get('document')
71+
if clist.pk is not None and document_id:
72+
document = get_object_or_404(clist.added_docs, id=document_id)
7373
clist.added_docs.remove(document)
7474

7575
return HttpResponseRedirect("")

0 commit comments

Comments
 (0)