Skip to content

Commit

Permalink
Merge pull request #528 from Gustavosdo/develop
Browse files Browse the repository at this point in the history
Fixed context.current_app in Django 1.10
  • Loading branch information
darklow committed Aug 18, 2016
2 parents 9e10585 + 2041a1d commit 9c217ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion suit/templatetags/suit_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def get_menu(context, request):
# Django 1.8 uses request.current_app instead of context.current_app
template_response = get_admin_site(request.current_app).index(request)
else:
template_response = get_admin_site(context.current_app).index(request)
try:
template_response = get_admin_site(context.current_app).index(request)
# Django 1.10 removed the current_app parameter for some classes and functions.
# Check the release notes.
except AttributeError:
template_response = get_admin_site(context.request.resolver_match.namespace).index(request)

try:
app_list = template_response.context_data['app_list']
Expand Down

0 comments on commit 9c217ee

Please sign in to comment.