Make streams_menu tag more robust in the face of "request" missing
from context, this would normally be an error but it can happen if a 404 is returned - Legacy-Id: 6268
This commit is contained in:
parent
56ea114e31
commit
c760b48b38
|
@ -1,6 +1,7 @@
|
|||
from django import template
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse as urlreverse
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from ietf.ietfauth.utils import has_role
|
||||
from ietf.group.models import Group
|
||||
|
@ -10,10 +11,10 @@ register = template.Library()
|
|||
|
||||
@register.inclusion_tag('base/streams_menu.html', takes_context=True)
|
||||
def streams_menu(context):
|
||||
user = context["request"].user
|
||||
|
||||
editable_streams = []
|
||||
|
||||
user = context["request"].user if "request" in context else AnonymousUser()
|
||||
|
||||
if user.is_authenticated():
|
||||
streams = StreamName.objects.exclude(slug="legacy")
|
||||
|
||||
|
|
Loading…
Reference in a new issue