From a397d766a0381cc723dc0b221a4b3748ddb92ca1 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 9 Nov 2018 20:09:04 +0300 Subject: [PATCH] Fix the NSFW setting In the user settings, the temporary NSFW allowance was not detected. This was due to use of a database lookup instead of the correct function. --- neluser/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neluser/views.py b/neluser/views.py index e67f324..75068b2 100644 --- a/neluser/views.py +++ b/neluser/views.py @@ -14,6 +14,7 @@ from django.utils.encoding import force_bytes from django.http import HttpResponse, Http404 from django.conf import settings from django.urls import reverse_lazy +from nsfw.views import is_nsfw_allowed from .forms import RegistrationForm, ChangePasswordForm, DeleteAccountForm from .models import NelUser @@ -27,7 +28,7 @@ def settings_default(request): @login_required def set_nsfw(request): ctx = { - 'nsfw_allowed': request.user.nsfw_allowed, + 'nsfw_allowed': is_nsfw_allowed(request), 'current_url': reverse_lazy('set_nsfw'), 'tab': 'preferences', 'active_block': 'nsfw_filter'