Skip to content

Commit ce247b8

Browse files
committed
Fix null reference when user does not have perms
1 parent 2526f9b commit ce247b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

suit/templatetags/suit_menu.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_menu(context, request):
3333
else:
3434
try:
3535
template_response = get_admin_site(context.current_app).index(request)
36-
# Django 1.10 removed the current_app parameter for some classes and functions.
36+
# Django 1.10 removed the current_app parameter for some classes and functions.
3737
# Check the release notes.
3838
except AttributeError:
3939
template_response = get_admin_site(context.request.resolver_match.namespace).index(request)
@@ -340,7 +340,7 @@ def convert_native_model(self, model, app_name):
340340
}
341341

342342
def get_native_model_url(self, model):
343-
return model.get('admin_url') or model.get('add_url', '')
343+
return model.get('admin_url') or model.get('add_url') or ''
344344

345345
def process_model(self, model, app_name):
346346
if 'model' in model:

0 commit comments

Comments
 (0)