From bed5b72864d32f9fe36ba75aa85de20cd67ecb0b Mon Sep 17 00:00:00 2001 From: Tobias Lindenberg Date: Sun, 10 Jan 2021 14:10:21 +0100 Subject: [PATCH] templatetags/theming_tags --- cookbook/templatetags/__init__.py | 0 cookbook/templatetags/theming_tags.py | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 cookbook/templatetags/__init__.py diff --git a/cookbook/templatetags/__init__.py b/cookbook/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/cookbook/templatetags/theming_tags.py b/cookbook/templatetags/theming_tags.py index 9172c9b67..8da775c24 100644 --- a/cookbook/templatetags/theming_tags.py +++ b/cookbook/templatetags/theming_tags.py @@ -1,7 +1,6 @@ +from cookbook.models import UserPreference from django import template from django.templatetags.static import static - -from cookbook.models import UserPreference from recipes.settings import STICKY_NAV_PREF_DEFAULT register = template.Library() @@ -33,7 +32,7 @@ def nav_color(request): @register.simple_tag def sticky_nav(request): if (not request.user.is_authenticated and STICKY_NAV_PREF_DEFAULT) or \ - (request.user.is_authenticated and request.user.userpreference.sticky_navbar): + (request.user.is_authenticated and request.user.userpreference.sticky_navbar): # noqa: E501 return 'position: sticky; top: 0; left: 0; z-index: 1000;' else: return ''