Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coderedcms/admin_urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.urls import include, path, re_path
from django.urls import include, path
from wagtail.admin import urls as wagtailadmin_urls
from coderedcms.views import import_index, import_pages_from_csv_file

Expand All @@ -8,5 +8,5 @@
import_index, name="import_index"),
path('codered/import-export/import_from_csv/',
import_pages_from_csv_file, name="import_from_csv"),
re_path(r'', include(wagtailadmin_urls)),
path('', include(wagtailadmin_urls)),
]
2 changes: 1 addition & 1 deletion coderedcms/importexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.db import models, transaction
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from modelcluster.models import get_all_child_relations
from wagtail.admin.widgets import AdminPageChooser
from wagtail.core.models import Page
Expand Down
6 changes: 3 additions & 3 deletions coderedcms/project_template/basic/project_name/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings
from django.urls import include, path, re_path
from django.urls import include, path
from django.contrib import admin
from wagtail.documents import urls as wagtaildocs_urls
from coderedcms import admin_urls as coderedadmin_urls
Expand All @@ -20,11 +20,11 @@
# For anything not caught by a more specific rule above, hand over to
# the page serving mechanism. This should be the last pattern in
# the list:
re_path(r'', include(codered_urls)),
path('', include(codered_urls)),

# Alternatively, if you want CMS pages to be served from a subpath
# of your site, rather than the site root:
# re_path(r"^pages/", include(codered_urls)),
# path("pages/", include(codered_urls)),
]


Expand Down
6 changes: 3 additions & 3 deletions coderedcms/project_template/sass/project_name/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings
from django.urls import include, path, re_path
from django.urls import include, path
from django.contrib import admin
from wagtail.documents import urls as wagtaildocs_urls
from coderedcms import admin_urls as coderedadmin_urls
Expand All @@ -20,11 +20,11 @@
# For anything not caught by a more specific rule above, hand over to
# the page serving mechanism. This should be the last pattern in
# the list:
re_path(r'', include(codered_urls)),
path('', include(codered_urls)),

# Alternatively, if you want CMS pages to be served from a subpath
# of your site, rather than the site root:
# re_path(r'^pages/', include(codered_urls)),
# path("pages/", include(codered_urls)),
]


Expand Down
4 changes: 2 additions & 2 deletions coderedcms/search_urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.urls import re_path
from django.urls import path
from coderedcms.views import search

urlpatterns = [
re_path(r'', search, name='codered_search'),
path('', search, name='codered_search'),
]
8 changes: 4 additions & 4 deletions coderedcms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

urlpatterns = [
# CodeRed custom URLs
re_path(r'^favicon\.ico$', favicon, name='codered_favicon'),
re_path(r'^robots\.txt$', robots, name='codered_robots'),
re_path(r'^sitemap\.xml$', sitemap, name='codered_sitemap'),
path(r'favicon.ico', favicon, name='codered_favicon'),
path(r'robots.txt', robots, name='codered_robots'),
path(r'sitemap.xml', sitemap, name='codered_sitemap'),
re_path(r'^{0}(?P<path>.*)$'.format(
crx_settings.CRX_PROTECTED_MEDIA_URL.lstrip('/')),
serve_protected_file,
Expand All @@ -34,5 +34,5 @@
path('ajax/calendar/events/', event_get_calendar_events, name='event_get_calendar_events'),

# Wagtail
re_path(r'', include(wagtailcore_urls)),
path('', include(wagtailcore_urls)),
]
4 changes: 2 additions & 2 deletions coderedcms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.core.paginator import Paginator, InvalidPage, EmptyPage, PageNotAnInteger
from django.shortcuts import redirect, render
from django.utils import timezone
from django.utils.translation import ungettext, gettext_lazy as _
from django.utils.translation import ngettext, gettext_lazy as _
from icalendar import Calendar
from wagtail.admin import messages
from wagtail.search.backends import db, get_search_backend
Expand Down Expand Up @@ -261,7 +261,7 @@ def import_pages_from_csv_file(request):
"Import failed: %(reason)s") % {'reason': e}
)
else:
messages.success(request, ungettext(
messages.success(request, ngettext(
"%(count)s page imported.",
"%(count)s pages imported.",
page_count) % {'count': page_count}
Expand Down
9 changes: 5 additions & 4 deletions coderedcms/wagtail_flexible_forms/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.conf.urls import url
from django.contrib.admin import SimpleListFilter
from django.contrib.admin.utils import quote
from django.shortcuts import redirect
from django.urls import reverse
from django.urls import path, reverse
from django.utils.translation import gettext_lazy as _
from wagtail.contrib.modeladmin.helpers import (
PermissionHelper, PagePermissionHelper, PageAdminURLHelper, AdminURLHelper,
Expand Down Expand Up @@ -302,9 +301,11 @@ def set_status_view(self, request, instance_pk):
def get_admin_urls_for_registration(self):
urls = super().get_admin_urls_for_registration()
urls += (
url(self.url_helper.get_action_url_pattern('set_status'),
path(
self.url_helper.get_action_url_pattern('set_status'),
self.set_status_view,
name=self.url_helper.get_action_url_name('set_status')),
name=self.url_helper.get_action_url_name('set_status')
),
)
return urls

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'Programming Language :: Python :: 3 :: Only',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Wagtail',
'Framework :: Wagtail :: 2',
'Topic :: Internet :: WWW/HTTP',
Expand All @@ -45,7 +46,7 @@
'beautifulsoup4>=4.8,<4.10', # should be the same as wagtail
'django-eventtools==1.0.*',
'django-bootstrap4==22.1',
'Django>=3.2,<4.0', # should be the same as wagtail
'Django>=3.2,<4.1', # should be the same as wagtail
'geocoder==1.38.*',
'icalendar==4.0.*',
'wagtail==2.16.*',
Expand Down