Django 1.10: User.is_authenticated is now a property

This commit is contained in:
Raphael Michel
2016-09-27 10:25:20 +02:00
parent fbd1c0d367
commit 3e318d0dcf
6 changed files with 11 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ def _detect_event(request):
LocaleMiddleware().process_request(request)
if not request.event.live:
if not request.user.is_authenticated() or not EventPermission.objects.filter(
if not request.user.is_authenticated or not EventPermission.objects.filter(
event=request.event, user=request.user).exists():
raise PermissionDenied(_('The selected ticket shop is currently not available.'))

View File

@@ -15,7 +15,7 @@ class LocaleSet(View):
locale = request.GET.get('locale')
if locale in [lc for lc, ll in settings.LANGUAGES]:
if request.user.is_authenticated():
if request.user.is_authenticated:
request.user.locale = locale
request.user.save()