misc: check user object is authenticated before getting its nameid (#31755)

This commit is contained in:
Frédéric Péters 2019-03-27 11:08:31 +01:00
parent b87525b073
commit b11d54cba8
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ def signed(obj):
@register.filter
def name_id(user):
if user:
if user and user.is_authenticated():
user_name_id = user.get_name_id()
if user_name_id:
return user_name_id