diff --git a/debug_toolbar/_compat.py b/debug_toolbar/_compat.py index ecd8fe068..7f3779650 100644 --- a/debug_toolbar/_compat.py +++ b/debug_toolbar/_compat.py @@ -1,5 +1,6 @@ try: from django.contrib.auth.decorators import login_not_required except ImportError: + def login_not_required(func): return func diff --git a/debug_toolbar/decorators.py b/debug_toolbar/decorators.py index 5dfd0796f..787282706 100644 --- a/debug_toolbar/decorators.py +++ b/debug_toolbar/decorators.py @@ -5,6 +5,7 @@ from debug_toolbar import settings as dt_settings + def require_show_toolbar(view): @functools.wraps(view) def inner(request, *args, **kwargs): diff --git a/debug_toolbar/panels/history/views.py b/debug_toolbar/panels/history/views.py index 1e0d4d261..fb6e28c93 100644 --- a/debug_toolbar/panels/history/views.py +++ b/debug_toolbar/panels/history/views.py @@ -6,6 +6,7 @@ from debug_toolbar.panels.history.forms import HistoryStoreForm from debug_toolbar.toolbar import DebugToolbar + @login_not_required @require_show_toolbar @render_with_toolbar_language @@ -37,6 +38,7 @@ def history_sidebar(request): return JsonResponse(context) return HttpResponseBadRequest("Form errors") + @login_not_required @require_show_toolbar @render_with_toolbar_language