diff --git a/www/conservancy/apps/assignment/migrations/0002_auto_20211206_2237.py b/www/conservancy/apps/assignment/migrations/0002_auto_20211206_2237.py index e5143c0a..b7cf2a66 100644 --- a/www/conservancy/apps/assignment/migrations/0002_auto_20211206_2237.py +++ b/www/conservancy/apps/assignment/migrations/0002_auto_20211206_2237.py @@ -1,6 +1,7 @@ # Generated by Django 1.11.29 on 2021-12-06 22:37 import datetime + from django.db import migrations, models import django_countries.fields diff --git a/www/conservancy/apps/assignment/migrations/0003_auto_20211206_2249.py b/www/conservancy/apps/assignment/migrations/0003_auto_20211206_2249.py index 9e7113b7..c7ac9084 100644 --- a/www/conservancy/apps/assignment/migrations/0003_auto_20211206_2249.py +++ b/www/conservancy/apps/assignment/migrations/0003_auto_20211206_2249.py @@ -1,8 +1,9 @@ # Generated by Django 1.11.29 on 2021-12-06 22:49 -from django.db import migrations, models import uuid +from django.db import migrations, models + class Migration(migrations.Migration): diff --git a/www/conservancy/apps/assignment/migrations/0004_auto_20230127_0602.py b/www/conservancy/apps/assignment/migrations/0004_auto_20230127_0602.py index 625d9dbc..79c5a77a 100644 --- a/www/conservancy/apps/assignment/migrations/0004_auto_20230127_0602.py +++ b/www/conservancy/apps/assignment/migrations/0004_auto_20230127_0602.py @@ -1,8 +1,10 @@ # Generated by Django 1.11.29 on 2023-01-27 06:02 from django.db import migrations, models + from ..models import validate_mutiple_urls + class Migration(migrations.Migration): dependencies = [ diff --git a/www/conservancy/apps/assignment/urls.py b/www/conservancy/apps/assignment/urls.py index 0502b0ef..980fe18c 100644 --- a/www/conservancy/apps/assignment/urls.py +++ b/www/conservancy/apps/assignment/urls.py @@ -2,7 +2,6 @@ from django.conf.urls import url from .views import AssignmentCreateView, AssignmentThanksView - urlpatterns = [ url(r'^$', AssignmentCreateView.as_view(), name='assignement-add'), url(r'^(?P[\w-]+)/$', AssignmentThanksView.as_view(), name='assignment-thanks'), diff --git a/www/conservancy/apps/assignment/views.py b/www/conservancy/apps/assignment/views.py index d6184395..4b10b0ce 100644 --- a/www/conservancy/apps/assignment/views.py +++ b/www/conservancy/apps/assignment/views.py @@ -6,6 +6,7 @@ from django.views.generic.edit import CreateView from .forms import AssignmentForm from .models import Assignment + class AssignmentCreateView(CreateView): """Show a form for the initial copyright assignment.""" diff --git a/www/conservancy/apps/blog/admin.py b/www/conservancy/apps/blog/admin.py index 539ed502..827cd0d7 100644 --- a/www/conservancy/apps/blog/admin.py +++ b/www/conservancy/apps/blog/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from .models import EntryTag, Entry +from .models import Entry, EntryTag class EntryTagAdmin(admin.ModelAdmin): diff --git a/www/conservancy/apps/blog/models.py b/www/conservancy/apps/blog/models.py index f37e4e26..73bf8028 100644 --- a/www/conservancy/apps/blog/models.py +++ b/www/conservancy/apps/blog/models.py @@ -1,7 +1,7 @@ from datetime import datetime, timedelta -from django.db import models from django.conf import settings +from django.db import models from ... import bsoup from ..staff.models import Person diff --git a/www/conservancy/apps/blog/urls.py b/www/conservancy/apps/blog/urls.py index 1c46610c..146f9843 100644 --- a/www/conservancy/apps/blog/urls.py +++ b/www/conservancy/apps/blog/urls.py @@ -1,10 +1,18 @@ from datetime import datetime -from django.conf.urls import url, include +from django.conf.urls import include, url -from .models import Entry, EntryTag from ..staff.models import Person -from .views import last_name, BlogYearArchiveView, BlogMonthArchiveView, BlogDayArchiveView, BlogDateDetailView, custom_index, query +from .models import Entry, EntryTag +from .views import ( + BlogDateDetailView, + BlogDayArchiveView, + BlogMonthArchiveView, + BlogYearArchiveView, + custom_index, + last_name, + query, +) extra_context = {} diff --git a/www/conservancy/apps/blog/views.py b/www/conservancy/apps/blog/views.py index 06f4c65a..4d3cdc9d 100644 --- a/www/conservancy/apps/blog/views.py +++ b/www/conservancy/apps/blog/views.py @@ -1,13 +1,18 @@ from datetime import datetime from functools import reduce -from django.views.generic import ListView -from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView -from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger +from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.shortcuts import get_object_or_404, render +from django.views.generic import ListView +from django.views.generic.dates import ( + DateDetailView, + DayArchiveView, + MonthArchiveView, + YearArchiveView, +) -from .models import Entry, EntryTag from ..staff.models import Person +from .models import Entry, EntryTag def OR_filter(field_name, objs): diff --git a/www/conservancy/apps/contacts/models.py b/www/conservancy/apps/contacts/models.py index 4cd4d1ef..14ac7484 100644 --- a/www/conservancy/apps/contacts/models.py +++ b/www/conservancy/apps/contacts/models.py @@ -1,5 +1,6 @@ from django.db import models + class ContactEntry(models.Model): """Conservancy contact system diff --git a/www/conservancy/apps/contacts/urls.py b/www/conservancy/apps/contacts/urls.py index 64d53300..e344847b 100644 --- a/www/conservancy/apps/contacts/urls.py +++ b/www/conservancy/apps/contacts/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import patterns, url, include +from django.conf.urls import include, patterns, url urlpatterns = patterns('conservancy.apps.contacts.views', (r'^/?$', 'subscribe'), diff --git a/www/conservancy/apps/contacts/views.py b/www/conservancy/apps/contacts/views.py index a727bdfa..154251a8 100644 --- a/www/conservancy/apps/contacts/views.py +++ b/www/conservancy/apps/contacts/views.py @@ -1,6 +1,6 @@ -from django.shortcuts import render from django import forms from django.forms import ModelForm +from django.shortcuts import render from .models import ContactEntry diff --git a/www/conservancy/apps/contractpatch/urls.py b/www/conservancy/apps/contractpatch/urls.py index fc1be6ec..8943efb9 100644 --- a/www/conservancy/apps/contractpatch/urls.py +++ b/www/conservancy/apps/contractpatch/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url, include +from django.conf.urls import include, url from . import views as cpatch_views diff --git a/www/conservancy/apps/events/admin.py b/www/conservancy/apps/events/admin.py index 6a2a95f9..0d4f8196 100644 --- a/www/conservancy/apps/events/admin.py +++ b/www/conservancy/apps/events/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from .models import EventTag, Event, EventMedia +from .models import Event, EventMedia, EventTag admin.site.register(EventTag) diff --git a/www/conservancy/apps/events/urls.py b/www/conservancy/apps/events/urls.py index ab146e48..addc19bc 100644 --- a/www/conservancy/apps/events/urls.py +++ b/www/conservancy/apps/events/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import patterns, url, include +from django.conf.urls import include, patterns, url from .models import Event diff --git a/www/conservancy/apps/events/views.py b/www/conservancy/apps/events/views.py index 5e10b813..5c91d425 100644 --- a/www/conservancy/apps/events/views.py +++ b/www/conservancy/apps/events/views.py @@ -1,8 +1,8 @@ # from django.views.generic.list_detail import object_list -from django.shortcuts import render -from django.http import Http404, HttpResponse -from django.template import loader from django.core.exceptions import ObjectDoesNotExist +from django.http import Http404, HttpResponse +from django.shortcuts import render +from django.template import loader from .models import Event diff --git a/www/conservancy/apps/fossy/migrations/0001_initial.py b/www/conservancy/apps/fossy/migrations/0001_initial.py index 725cfbbe..d339c953 100644 --- a/www/conservancy/apps/fossy/migrations/0001_initial.py +++ b/www/conservancy/apps/fossy/migrations/0001_initial.py @@ -1,8 +1,9 @@ # Generated by Django 1.11.29 on 2023-01-27 06:19 -from django.db import migrations, models import uuid +from django.db import migrations, models + class Migration(migrations.Migration): diff --git a/www/conservancy/apps/fossy/urls.py b/www/conservancy/apps/fossy/urls.py index b26789ae..fbbabd19 100644 --- a/www/conservancy/apps/fossy/urls.py +++ b/www/conservancy/apps/fossy/urls.py @@ -2,7 +2,6 @@ from django.conf.urls import url from .views import CommunityTrackProposalCreateView, CommunityTrackProposalThanksView - urlpatterns = [ url(r'^community-tracks/$', CommunityTrackProposalCreateView.as_view(), name='fossy-add'), url(r'^(?P[\w-]+)/$', CommunityTrackProposalThanksView.as_view(), name='fossy-thanks'), diff --git a/www/conservancy/apps/news/admin.py b/www/conservancy/apps/news/admin.py index fbecace3..49bc647b 100644 --- a/www/conservancy/apps/news/admin.py +++ b/www/conservancy/apps/news/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from .models import PressRelease, ExternalArticleTag, ExternalArticle +from .models import ExternalArticle, ExternalArticleTag, PressRelease class PressReleaseAdmin(admin.ModelAdmin): diff --git a/www/conservancy/apps/news/models.py b/www/conservancy/apps/news/models.py index c51ea69b..b19cea09 100644 --- a/www/conservancy/apps/news/models.py +++ b/www/conservancy/apps/news/models.py @@ -1,12 +1,12 @@ from datetime import datetime, timedelta -from django.db import models from django.conf import settings from django.contrib.sites.models import Site +from django.db import models from ... import bsoup -from ..staff.models import Person from ..events.models import Event +from ..staff.models import Person class PressRelease(models.Model, bsoup.SoupModelMixin): diff --git a/www/conservancy/apps/news/templatetags/date_within.py b/www/conservancy/apps/news/templatetags/date_within.py index 5213759d..207bca71 100644 --- a/www/conservancy/apps/news/templatetags/date_within.py +++ b/www/conservancy/apps/news/templatetags/date_within.py @@ -1,5 +1,6 @@ +from datetime import datetime, timedelta + from django import template -from datetime import timedelta, datetime register = template.Library() diff --git a/www/conservancy/apps/news/templatetags/min.py b/www/conservancy/apps/news/templatetags/min.py index f54c4616..632d8369 100644 --- a/www/conservancy/apps/news/templatetags/min.py +++ b/www/conservancy/apps/news/templatetags/min.py @@ -1,4 +1,5 @@ from django import template + register = template.Library() @register.filter diff --git a/www/conservancy/apps/news/templatetags/subtract.py b/www/conservancy/apps/news/templatetags/subtract.py index f79c514f..111daffc 100644 --- a/www/conservancy/apps/news/templatetags/subtract.py +++ b/www/conservancy/apps/news/templatetags/subtract.py @@ -1,4 +1,5 @@ from django import template + register = template.Library() @register.filter diff --git a/www/conservancy/apps/news/urls.py b/www/conservancy/apps/news/urls.py index f7ac8e7c..33b57f74 100644 --- a/www/conservancy/apps/news/urls.py +++ b/www/conservancy/apps/news/urls.py @@ -17,11 +17,17 @@ # along with this program in a file in the toplevel directory called # "AGPLv3". If not, see . -from django.conf.urls import url, include from django.conf import settings +from django.conf.urls import include, url -from .models import PressRelease, ExternalArticle -from .views import NewsYearArchiveView, NewsMonthArchiveView, NewsDayArchiveView, NewsDateDetailView, listing +from .models import ExternalArticle, PressRelease +from .views import ( + NewsDateDetailView, + NewsDayArchiveView, + NewsMonthArchiveView, + NewsYearArchiveView, + listing, +) info_dict = { 'queryset': PressRelease.objects.all().filter(sites__id__exact=settings.SITE_ID), diff --git a/www/conservancy/apps/news/views.py b/www/conservancy/apps/news/views.py index bae3cefb..a1533b6a 100644 --- a/www/conservancy/apps/news/views.py +++ b/www/conservancy/apps/news/views.py @@ -1,14 +1,18 @@ from datetime import datetime -from django.views.generic import ListView -from django.shortcuts import render -from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView -from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger +from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import HttpResponse +from django.shortcuts import render +from django.views.generic import ListView +from django.views.generic.dates import ( + DateDetailView, + DayArchiveView, + MonthArchiveView, + YearArchiveView, +) -from .models import ExternalArticle -from .models import PressRelease from ..events.models import Event +from .models import ExternalArticle, PressRelease class NewsListView(ListView): diff --git a/www/conservancy/apps/staff/models.py b/www/conservancy/apps/staff/models.py index 98284b8d..8b194e64 100644 --- a/www/conservancy/apps/staff/models.py +++ b/www/conservancy/apps/staff/models.py @@ -1,5 +1,6 @@ from django.db import models + class Person(models.Model): """Staff members diff --git a/www/conservancy/apps/summit_registration/models.py b/www/conservancy/apps/summit_registration/models.py index 1bb0dc95..ae2e8b3a 100644 --- a/www/conservancy/apps/summit_registration/models.py +++ b/www/conservancy/apps/summit_registration/models.py @@ -1,5 +1,6 @@ from django.db import models + class SummitRegistration(models.Model): """Form fields for summit registrants""" diff --git a/www/conservancy/apps/summit_registration/urls.py b/www/conservancy/apps/summit_registration/urls.py index 1597b0ef..7542bcec 100644 --- a/www/conservancy/apps/summit_registration/urls.py +++ b/www/conservancy/apps/summit_registration/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import patterns, url, include +from django.conf.urls import include, patterns, url urlpatterns = patterns('conservancy.apps.summit_registration.views', (r'^/?$', 'register'), diff --git a/www/conservancy/apps/summit_registration/views.py b/www/conservancy/apps/summit_registration/views.py index 2dcf1395..8fe75929 100644 --- a/www/conservancy/apps/summit_registration/views.py +++ b/www/conservancy/apps/summit_registration/views.py @@ -1,6 +1,7 @@ -from django.shortcuts import render -from django import forms from conervancy.apps.summit_registration.models import SummitRegistration +from django import forms +from django.shortcuts import render + def register(request): """Summit registration form view diff --git a/www/conservancy/apps/supporters/models.py b/www/conservancy/apps/supporters/models.py index a9bf062e..08cb71b5 100644 --- a/www/conservancy/apps/supporters/models.py +++ b/www/conservancy/apps/supporters/models.py @@ -1,5 +1,6 @@ from django.db import models + class Supporter(models.Model): """Conservancy Supporter listing""" diff --git a/www/conservancy/apps/worldmap/models.py b/www/conservancy/apps/worldmap/models.py index 9a147d4f..107020f9 100644 --- a/www/conservancy/apps/worldmap/models.py +++ b/www/conservancy/apps/worldmap/models.py @@ -1,5 +1,6 @@ from django.db import models + class EarthLocation(models.Model): """Represents latitude and longitude, with a label""" diff --git a/www/conservancy/bsoup.py b/www/conservancy/bsoup.py index b2565ec3..5142afe6 100644 --- a/www/conservancy/bsoup.py +++ b/www/conservancy/bsoup.py @@ -5,6 +5,7 @@ import re import bs4 import bs4.element + class BeautifulSoup(bs4.BeautifulSoup): """A wrapper of the original BeautifulSoup class, with convenience methods added.""" diff --git a/www/conservancy/static/projects/policies/publish-policy.py b/www/conservancy/static/projects/policies/publish-policy.py index 05d2abf3..f9ffb25e 100755 --- a/www/conservancy/static/projects/policies/publish-policy.py +++ b/www/conservancy/static/projects/policies/publish-policy.py @@ -13,9 +13,9 @@ import tempfile try: import markdown - from markdown.extensions import tables as mdx_tables from markdown.extensions import sane_lists as mdx_sane_lists from markdown.extensions import smarty as mdx_smarty + from markdown.extensions import tables as mdx_tables from markdown.extensions import toc as mdx_toc markdown_import_success = True except ImportError: diff --git a/www/conservancy/static/views.py b/www/conservancy/static/views.py index 31db72f4..34037a32 100644 --- a/www/conservancy/static/views.py +++ b/www/conservancy/static/views.py @@ -1,5 +1,6 @@ import mimetypes import os.path + from django.http import HttpResponse from django.template.response import TemplateResponse diff --git a/www/conservancy/urls.py b/www/conservancy/urls.py index ab7cb06b..1c44ba72 100644 --- a/www/conservancy/urls.py +++ b/www/conservancy/urls.py @@ -17,7 +17,7 @@ # along with this program in a file in the toplevel directory called # "AGPLv3". If not, see . -from django.conf.urls import url, include +from django.conf.urls import include, url from django.contrib import admin from . import feeds, frontpage, sponsors diff --git a/www/conservancy_ssl_wrapper.py b/www/conservancy_ssl_wrapper.py index 218f0823..bf840708 100644 --- a/www/conservancy_ssl_wrapper.py +++ b/www/conservancy_ssl_wrapper.py @@ -21,6 +21,7 @@ # so we just bypass it altogether and set the relevant variable here. # See deployment documentation for more info. from os import environ + environ["DJANGO_SETTINGS_MODULE"] = 'conservancy_ssl.settings' environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org' diff --git a/www/conservancy_wrapper.py b/www/conservancy_wrapper.py index 25903d89..74568062 100644 --- a/www/conservancy_wrapper.py +++ b/www/conservancy_wrapper.py @@ -2,6 +2,7 @@ # so we just bypass it altogether and set the relevant variable here. # See deployment documentation for more info. from os import environ + environ["DJANGO_SETTINGS_MODULE"] = 'conservancy.settings' environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org' diff --git a/www/modpythoncustom.py b/www/modpythoncustom.py index 5041e038..d3234566 100644 --- a/www/modpythoncustom.py +++ b/www/modpythoncustom.py @@ -1,5 +1,6 @@ from mod_python import apache + # 404 should do NOTHING so apache can handle it. This view is referenced # in sflc.urls def view404(request): @@ -30,6 +31,8 @@ def outputfilter(filter): if s is None: filter.close() +from django.core.handlers.modpython import * + # This is unreferenced from this file, but it must be imported to # enable template inheritance in the outputfilter! import django.template.loader @@ -37,7 +40,6 @@ import django.template.loader # And now we override a few things in the module # django.core.handlers.modpython -from django.core.handlers.modpython import * del handler class ModPythonRequest(ModPythonRequest): diff --git a/www/podjango/admin.py b/www/podjango/admin.py index b9623202..aa776620 100644 --- a/www/podjango/admin.py +++ b/www/podjango/admin.py @@ -18,7 +18,8 @@ # from django.contrib import admin -from .models import CastTag, Cast +from .models import Cast, CastTag + class CastTagAdmin(admin.ModelAdmin): prepopulated_fields = {'slug': ('label',)} diff --git a/www/podjango/feeds.py b/www/podjango/feeds.py index 7d674b28..7c4b84e4 100644 --- a/www/podjango/feeds.py +++ b/www/podjango/feeds.py @@ -21,11 +21,11 @@ from datetime import datetime import itertools import operator -from django.contrib.sites.shortcuts import get_current_site -from django.contrib.syndication.views import add_domain, Feed -from django.utils.feedgenerator import Rss201rev2Feed -from django.shortcuts import render from django.conf import settings +from django.contrib.sites.shortcuts import get_current_site +from django.contrib.syndication.views import Feed, add_domain +from django.shortcuts import render +from django.utils.feedgenerator import Rss201rev2Feed from .models import Cast diff --git a/www/podjango/frontpage.py b/www/podjango/frontpage.py index d0faa3fd..68604dde 100644 --- a/www/podjango/frontpage.py +++ b/www/podjango/frontpage.py @@ -17,11 +17,13 @@ # along with this program in a file in the toplevel directory called # "AGPLv3". If not, see . -from django.shortcuts import render from datetime import datetime, timedelta +from django.shortcuts import render + from .models import Cast + def view(request): """Cast front page view Performs all object queries necessary to render the front page. diff --git a/www/podjango/models.py b/www/podjango/models.py index 607ad74e..53c3db52 100644 --- a/www/podjango/models.py +++ b/www/podjango/models.py @@ -16,11 +16,12 @@ # along with this program in a file in the toplevel directory called # "AGPLv3". If not, see . # -from django.db import models -from django.conf import settings -from django.urls import reverse from datetime import datetime, timedelta +from django.conf import settings +from django.db import models +from django.urls import reverse + class CastTag(models.Model): """Tagging for casts""" diff --git a/www/podjango/templatetags/date_within.py b/www/podjango/templatetags/date_within.py index 5213759d..207bca71 100644 --- a/www/podjango/templatetags/date_within.py +++ b/www/podjango/templatetags/date_within.py @@ -1,5 +1,6 @@ +from datetime import datetime, timedelta + from django import template -from datetime import timedelta, datetime register = template.Library() diff --git a/www/podjango/urls.py b/www/podjango/urls.py index 4ef3ded7..bd27d9c7 100644 --- a/www/podjango/urls.py +++ b/www/podjango/urls.py @@ -18,13 +18,18 @@ # "AGPLv3". If not, see . from django.conf import settings -from django.conf.urls import url, include +from django.conf.urls import include, url from django.contrib import admin from django.contrib.syndication.views import Feed -from django.views.generic.dates import DateDetailView, DayArchiveView, MonthArchiveView, YearArchiveView +from django.views.generic.dates import ( + DateDetailView, + DayArchiveView, + MonthArchiveView, + YearArchiveView, +) from . import frontpage -from .feeds import feed_dict, view, Mp3CastFeed, OggCastFeed +from .feeds import Mp3CastFeed, OggCastFeed, feed_dict, view from .models import Cast, CastTag from .views import custom_index, query diff --git a/www/podjango/views.py b/www/podjango/views.py index 14af20ac..359ce810 100644 --- a/www/podjango/views.py +++ b/www/podjango/views.py @@ -19,8 +19,8 @@ from datetime import datetime from functools import reduce -from django.views.generic.list import ListView from django.shortcuts import get_object_or_404, render +from django.views.generic.list import ListView from .models import Cast, CastTag