Skip to content

Commit

Permalink
fix: point menu item for editoral stream to rswg documents (#5206)
Browse files Browse the repository at this point in the history
* fix: connect the menu item for the editoral stream to the rswg documents page.

* chore: repair merge damage

* fix: address review by shortcircuiting redirects
  • Loading branch information
rjsparks authored Feb 27, 2023
1 parent 0ec1264 commit 5c9a364
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ietf/group/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import debug # pyflakes:ignore

from ietf.doc.factories import DocumentFactory, WgDraftFactory
from ietf.doc.factories import DocumentFactory, WgDraftFactory, EditorialDraftFactory
from ietf.doc.models import DocEvent, RelatedDocument, Document
from ietf.group.models import Role, Group
from ietf.group.utils import get_group_role_emails, get_child_group_role_emails, get_group_ad_emails
Expand All @@ -41,6 +41,11 @@ def test_stream_documents(self):
self.assertEqual(r.status_code, 200)
self.assertContains(r, draft.name)

EditorialDraftFactory() # Quick way to ensure RSWG exists.
r = self.client.get(urlreverse("ietf.group.views.stream_documents", kwargs=dict(acronym="editorial")))
self.assertRedirects(r, expected_url=urlreverse('ietf.group.views.group_documents',kwargs={"acronym":"rswg"}))


def test_stream_edit(self):
EmailFactory(address="[email protected]")

Expand Down
2 changes: 2 additions & 0 deletions ietf/group/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,8 @@ def streams(request):
return render(request, 'group/index.html', {'streams':streams})

def stream_documents(request, acronym):
if acronym == "editorial":
return HttpResponseRedirect(urlreverse(group_documents, kwargs=dict(acronym="rswg")))
streams = [ s.slug for s in StreamName.objects.all().exclude(slug__in=['ietf', 'legacy']) ]
if not acronym in streams:
raise Http404("No such stream: %s" % acronym)
Expand Down

0 comments on commit 5c9a364

Please sign in to comment.