fix: point menu item for editoral stream to rswg documents (#5206)
* fix: connect the menu item for the editoral stream to the rswg documents page. * chore: repair merge damage * fix: address review by shortcircuiting redirects
This commit is contained in:
parent
0ec12647e1
commit
5c9a3642bd
|
@ -17,7 +17,7 @@ from django.utils import timezone
|
|||
|
||||
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
|
||||
|
@ -41,6 +41,11 @@ class StreamTests(TestCase):
|
|||
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="ad2@ietf.org")
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue