Skip to content

Commit

Permalink
Fixed 500 error when no permission to module
Browse files Browse the repository at this point in the history
Error was occuring when user had no permission to module that was added to menu
due to missing code for handling None elements in menu (that are returned on
such conditions, so items that user has no permissions to won't have entries
displayed in menu).
  • Loading branch information
gbdlin committed Nov 8, 2018
1 parent b0dc5fb commit b20bfb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions admin_toolbox/sidebar/templatetags/admin_toolbox_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def admin_sidebar_content(context, menu_name='default'):
continue

item = current_items[item_no]
if item is None:
current_items.pop(item_no)
continue

if 'items' in item:
level_stack.append((len(level_stack), item['items'], 0))
continue
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
setup(
name='django-admin-toolbox',

version='1.0.0dev11',
version='1.0.0dev12',

description='Django admin toolbox - bunch of improvements for default django admin',
long_description=long_description,
Expand Down

0 comments on commit b20bfb5

Please sign in to comment.