Updates for django 2.2
authorMagnus Hagander <[email protected]>
Wed, 1 Apr 2020 19:29:07 +0000 (21:29 +0200)
committerMagnus Hagander <[email protected]>
Wed, 1 Apr 2020 19:33:29 +0000 (21:33 +0200)
pgcommitfest/commitfest/views.py
pgcommitfest/commitfest/widgets.py
pgcommitfest/settings.py
pgcommitfest/urls.py

index c52ff9c2bd722a1a5ce17aa19646b08f3b57b21a..3a85f54b09abb75606d27e6ba7efac2102830099 100644 (file)
@@ -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
index fbce50dff4241106fc47d8deaff51e32a033d3a8..4af8b2d8c654b213e51c5c99214445e1d397550c 100644 (file)
@@ -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
index 0b26982f3886faf2d9e6d0527549c65f3ef6879a..3df6c0595576ccc6c5972a86171bc3541d1ce07d 100644 (file)
@@ -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',
index 71b13063dcca5df7f56b017994de832480a1a3ac..cb425547e4fcee97d1ae0dcf2e75749b55eb5c85 100644 (file)
@@ -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),
 ]