summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2020-04-01 19:29:07 +0000
committerMagnus Hagander2020-04-01 19:33:29 +0000
commitf67aa10a515428b1e63bc4f24e1f85ee9fe2085b (patch)
treecc78fd4497590fc21db23383841af02749331ee1
parent29dce1f6045e26c2cd0af7d9d277405ac21ba821 (diff)
Updates for django 2.2
-rw-r--r--pgcommitfest/commitfest/views.py6
-rw-r--r--pgcommitfest/commitfest/widgets.py2
-rw-r--r--pgcommitfest/settings.py2
-rw-r--r--pgcommitfest/urls.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py
index c52ff9c..3a85f54 100644
--- a/pgcommitfest/commitfest/views.py
+++ b/pgcommitfest/commitfest/views.py
@@ -127,7 +127,7 @@ def commitfest(request, cfid):
whereclauses.append("NOT EXISTS (SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id)")
elif request.GET['author'] == '-3':
# Checking for "yourself" requires the user to be logged in!
- if not request.user.is_authenticated():
+ if not request.user.is_authenticated:
return HttpResponseRedirect('%s?next=%s' % (settings.LOGIN_URL, request.path))
whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(self)s)")
whereparams['self'] = request.user.id
@@ -144,7 +144,7 @@ def commitfest(request, cfid):
whereclauses.append("NOT EXISTS (SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id)")
elif request.GET['reviewer'] == '-3':
# Checking for "yourself" requires the user to be logged in!
- if not request.user.is_authenticated():
+ if not request.user.is_authenticated:
return HttpResponseRedirect('%s?next=%s' % (settings.LOGIN_URL, request.path))
whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(self)s)")
whereparams['self'] = request.user.id
@@ -261,7 +261,7 @@ def patch(request, cfid, patchid):
# XXX: this creates a session, so find a smarter way. Probably handle
# it in the callback and just ask the user then?
- if request.user.is_authenticated():
+ if request.user.is_authenticated:
committer = [c for c in committers if c.user == request.user]
if len(committer) > 0:
is_committer = True
diff --git a/pgcommitfest/commitfest/widgets.py b/pgcommitfest/commitfest/widgets.py
index fbce50d..4af8b2d 100644
--- a/pgcommitfest/commitfest/widgets.py
+++ b/pgcommitfest/commitfest/widgets.py
@@ -3,7 +3,7 @@ from django.utils.safestring import mark_safe
class ThreadPickWidget(TextInput):
- def render(self, name, value, attrs=None):
+ def render(self, name, value, attrs=None, renderer=None):
attrs['class'] += ' threadpick-input'
html = super(ThreadPickWidget, self).render(name, value, attrs)
html = html + '&nbsp;<button class="btn btn-default attachThreadButton" id="btn_%s">Find thread</button>' % name
diff --git a/pgcommitfest/settings.py b/pgcommitfest/settings.py
index 0b26982..3df6c05 100644
--- a/pgcommitfest/settings.py
+++ b/pgcommitfest/settings.py
@@ -86,7 +86,7 @@ STATICFILES_FINDERS = (
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'REALLYCHANGETHISINLOCAL_SETTINGS.PY'
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
diff --git a/pgcommitfest/urls.py b/pgcommitfest/urls.py
index 71b1306..cb42554 100644
--- a/pgcommitfest/urls.py
+++ b/pgcommitfest/urls.py
@@ -54,5 +54,5 @@ urlpatterns = [
# url(r'^admin/doc/', include('django.contrib.admindocs.urls)),
# Uncomment the next line to enable the admin:
- url(r'^admin/', include(admin.site.urls)),
+ url(r'^admin/', admin.site.urls),
]