[extensions-web] is_authenticated is now a property
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] is_authenticated is now a property
- Date: Sat, 12 Jan 2019 14:10:22 +0000 (UTC)
commit 236aef4d34d5852ffdaf2b6ed0e0cf3ad7aad0c3
Author: Claude Paroz <claude 2xlibre net>
Date: Sat Jan 12 11:20:12 2019 +0100
is_authenticated is now a property
Closes: https://gitlab.gnome.org/Infrastructure/extensions-web/merge_requests/7
Signed-off-by: Yuri Konotopov <ykonotopov gnome org>
sweettooth/auth/context_processors.py | 4 ++--
sweettooth/errorreports/views.py | 2 +-
sweettooth/ratings/models.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/sweettooth/auth/context_processors.py b/sweettooth/auth/context_processors.py
index 0b541bf..39e6a64 100644
--- a/sweettooth/auth/context_processors.py
+++ b/sweettooth/auth/context_processors.py
@@ -2,7 +2,7 @@
from sweettooth.auth import forms
def login_form(request):
- if request.user.is_authenticated():
- return dict()
+ if request.user.is_authenticated:
+ return {}
return dict(login_popup_form=forms.InlineAuthenticationForm())
diff --git a/sweettooth/errorreports/views.py b/sweettooth/errorreports/views.py
index 45b55b2..4d35e1b 100644
--- a/sweettooth/errorreports/views.py
+++ b/sweettooth/errorreports/views.py
@@ -20,7 +20,7 @@ def report_error(request, extension):
if request.method == 'POST':
form = ErrorReportForm(data=request.POST)
- if not request.user.is_authenticated():
+ if not request.user.is_authenticated:
return HttpResponseForbidden()
if form.is_valid():
diff --git a/sweettooth/ratings/models.py b/sweettooth/ratings/models.py
index df5dca1..7564281 100644
--- a/sweettooth/ratings/models.py
+++ b/sweettooth/ratings/models.py
@@ -10,6 +10,6 @@ class RatingComment(Comment):
rating = models.IntegerField(blank=True, default=-1)
def make_sure_user_was_authenticated(sender, comment, request, **kwargs):
- return request.user.is_authenticated()
+ return request.user.is_authenticated
comment_will_be_posted.connect(make_sure_user_was_authenticated)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]