Changeset - 05bee8b3c3b9
[Not reviewed]
0 5 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-11-26 02:00:20
ben@sturm.com.au
Apply `futurize --stage1` (safe) Python 2/3 compatibility changes.
5 files changed with 10 insertions and 7 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/blog/views.py
Show inline comments
...
 
@@ -8,2 +8,3 @@ from django.shortcuts import get_object_or_404, render
 
from datetime import datetime
 
from functools import reduce
 

	
www/conservancy/apps/events/views.py
Show inline comments
...
 
@@ -21,3 +21,3 @@ def event_detail(request, year, slug, queryset, **kwargs):
 
    except ObjectDoesNotExist:
 
        raise Http404, "Event does not exist"
 
        raise Http404("Event does not exist")
 
    return render(request, 'events/event_detail.html', {'event': event})
...
 
@@ -29,3 +29,3 @@ def custom_index(request, queryset, *args, **kwargs):
 
    future_events = None
 
    if not request.GET.has_key("page"):
 
    if "page" not in request.GET:
 
        future_events = Event.future.all().order_by("date")
www/conservancy/feeds.py
Show inline comments
...
 
@@ -10,2 +10,3 @@ import itertools
 
import operator
 
from functools import reduce
 

	
...
 
@@ -173,3 +174,3 @@ class BlogFeed(ConservancyFeedBase):
 
            for tag in tags:
 
                if done.has_key(tag): continue
 
                if tag in done: continue
 
                if firstTime:
...
 
@@ -200,3 +201,3 @@ class BlogFeed(ConservancyFeedBase):
 
            for tag in tags:
 
                if done.has_key(tag): continue
 
                if tag in done: continue
 
                if firstTime:
www/conservancy/middleware.py
Show inline comments
 
from future.utils import raise_
 
from django import http
...
 
@@ -29,3 +30,3 @@ class ForceCanonicalHostnameMiddleware(object):
 
            if settings.DEBUG and request.method == 'POST':
 
                raise RuntimeError, "You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to %s%s (note the trailing slash), or set APPEND_SLASH=False in your Django settings." % (new_url[0], new_url[1])
 
                raise_(RuntimeError, "You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to %s%s (note the trailing slash), or set APPEND_SLASH=False in your Django settings." % (new_url[0], new_url[1]))
 
        # Strip trailing index.html
...
 
@@ -35,3 +36,3 @@ class ForceCanonicalHostnameMiddleware(object):
 
        if hasattr(settings, "REDIRECT_TABLE"):
 
            if settings.REDIRECT_TABLE.has_key(new_url[1]):
 
            if new_url[1] in settings.REDIRECT_TABLE:
 
                new_url[1] = settings.REDIRECT_TABLE[new_url[1]]
www/modpythoncustom.py
Show inline comments
...
 
@@ -44,3 +44,3 @@ class ModPythonRequest(ModPythonRequest):
 
    def is_secure(self):
 
        return self._req.get_options().has_key('HTTPS') and self._req.get_options()['HTTPS'] == 'on'
 
        return 'HTTPS' in self._req.get_options() and self._req.get_options()['HTTPS'] == 'on'
 

	
0 comments (0 inline, 0 general)