diff --git a/kitsune/products/migrations/0020_remove_sumoplaceholderpage_page_ptr_and_more.py b/kitsune/products/migrations/0020_remove_sumoplaceholderpage_page_ptr_and_more.py new file mode 100644 index 00000000000..0e0453a28b3 --- /dev/null +++ b/kitsune/products/migrations/0020_remove_sumoplaceholderpage_page_ptr_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.16 on 2024-10-14 03:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("products", "0019_alter_singleproductindexpage_body"), + ] + + operations = [ + migrations.RemoveField( + model_name="sumoplaceholderpage", + name="page_ptr", + ), + migrations.DeleteModel( + name="SingleProductIndexPage", + ), + migrations.DeleteModel( + name="SumoPlaceholderPage", + ), + ] diff --git a/kitsune/products/models/models.py b/kitsune/products/models.py similarity index 98% rename from kitsune/products/models/models.py rename to kitsune/products/models.py index 7bd1ad0e78e..7118636cc6b 100644 --- a/kitsune/products/models/models.py +++ b/kitsune/products/models.py @@ -8,8 +8,6 @@ from kitsune.sumo.urlresolvers import reverse from kitsune.sumo.utils import webpack_static -from wagtail.models import PreviewableMixin - HOT_TOPIC_SLUG = "hot" @@ -29,7 +27,7 @@ class Meta: abstract = True -class Product(BaseProductTopic, PreviewableMixin): +class Product(BaseProductTopic): codename = models.CharField(max_length=255, blank=True, default="") slug = models.SlugField() image = ImagePlusField( diff --git a/kitsune/products/models/__init__.py b/kitsune/products/models/__init__.py deleted file mode 100644 index 327332ad532..00000000000 --- a/kitsune/products/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .models import * # noqa -from .pages import * # noqa diff --git a/kitsune/products/models/pages.py b/kitsune/products/models/pages.py deleted file mode 100644 index 19c341d09ca..00000000000 --- a/kitsune/products/models/pages.py +++ /dev/null @@ -1,137 +0,0 @@ -from django.db import models -from django.http import Http404 - -from kitsune.products.models import Product -from kitsune.wiki.facets import topics_for -from kitsune.wiki.utils import get_featured_articles - -from typing import List - -from wagtail import blocks -from wagtail.fields import StreamField -from wagtail.admin.panels import FieldPanel -from wagtail.models import Page -from wagtail.snippets.blocks import SnippetChooserBlock - - -class SumoPlaceholderPage(Page): - """A page used to allow for child pages to be created - so we can have a proper Wagtail tree structure""" - - settings_panels = Page.settings_panels + [ - FieldPanel("show_in_menus"), - ] - content_panels = [ - FieldPanel("title"), - FieldPanel("slug"), - ] - - promote_panels: List[FieldPanel] = [] - preview_modes: List[Page.preview_modes] = [] - - is_placeholder = True - - def serve(self, request): - raise Http404 - - -# Define Blocks for Stream Fields -# Wagtail: This is a StructBlock that allows selection of a Product Snippet -class ProductSnippetBlock(blocks.StructBlock): - """Block for product snippets""" - - product = SnippetChooserBlock(target_model="products.Product", required=True) - - class Meta: - template = "products/blocks/product_snippet_block.html" - icon = "placeholder" - label = "Product Card" - - -class SearchBlock(blocks.StructBlock): - """Block for the search form""" - - def get_context(self, value, parent_context=None): - context = super().get_context(value, parent_context=parent_context) - return context - - class Meta: - template = "products/blocks/search_block.html" - icon = "search" - label = "Search Form" - - -class CTABlock(blocks.StructBlock): - """Block for the call to action""" - - headline = blocks.CharBlock(required=True, max_length=255) - details = blocks.RichTextBlock(required=True) - link = blocks.URLBlock(required=True) - type = blocks.ChoiceBlock( - choices=[ - ("Community", "Community"), - ("Paid", "Paid"), - ("Other", "Other"), - ] - ) - - class Meta: - template = "products/blocks/cta_block.html" - icon = "plus-inverse" - label = "Call to Action" - - -class FeaturedArticlesBlock(blocks.StructBlock): - """Block for the featured articles""" - - def get_context(self, value, parent_context=None): - context = super().get_context(value, parent_context=parent_context) - context["featured"] = get_featured_articles(product=context["product"]) - return context - - class Meta: - template = "products/blocks/featured_articles_block.html" - icon = "doc-full-inverse" - label = "Featured Articles" - - -class FrequentTopicsBlock(blocks.StructBlock): - """Block for the frequent topics""" - - def get_context(self, value, parent_context=None): - context = super().get_context(value, parent_context=parent_context) - context["topics"] = topics_for( - user=context["user"], product=context["product"], parent=None - ) - return context - - class Meta: - template = "products/blocks/frequent_topics_block.html" - icon = "doc-full-inverse" - label = "Frequent Topics" - max = 1 - - -class SingleProductIndexPage(Page): - """A page representing a product""" - - template = "products/product_wagtail.html" - - product = models.ForeignKey(Product, on_delete=models.PROTECT, related_name="product_index") - - body = StreamField( - [ - ("search", SearchBlock()), - ("cta", CTABlock()), - ("featured_articles", FeaturedArticlesBlock()), - ("product_snippet", ProductSnippetBlock()), - ("frequent_topics", FrequentTopicsBlock()), - ("text", blocks.RichTextBlock()), - ] - ) - - content_panels = Page.content_panels + [FieldPanel("product"), FieldPanel("body")] - - class Meta: - verbose_name = "Single Product Index" - verbose_name_plural = "Single Product Indexes" diff --git a/kitsune/products/tests/test_wt_pages.py b/kitsune/products/tests/test_wt_pages.py deleted file mode 100644 index b73f445c177..00000000000 --- a/kitsune/products/tests/test_wt_pages.py +++ /dev/null @@ -1,74 +0,0 @@ -from django.http import Http404 -from django.test import RequestFactory - -from wagtail.models import Page -from wagtail.test.utils import WagtailPageTestCase -from wagtail.views import serve as wagtail_serve - -from kitsune.products.models import SingleProductIndexPage, SumoPlaceholderPage -from kitsune.products.tests import ProductFactory - - -class SumoCMSTests(WagtailPageTestCase): - def test_can_create_dummy_page(self): - """Test that our page was created""" - homepage = Page.objects.get(url_path="/") - product_dummy = SumoPlaceholderPage(title="Product Dummy", slug="products") - homepage.add_child(instance=product_dummy) - - # See if it is now in the database - retrieved = Page.objects.get(id=product_dummy.id) - self.assertEqual(retrieved.title, "Product Dummy") - - def test_can_create_product_index_page(self): - """Test that we can create a single product index page""" - homepage = Page.objects.get(url_path="/") - product_dummy = SumoPlaceholderPage(title="Product Dummy", slug="products") - homepage.add_child(instance=product_dummy) - test_product = ProductFactory( - title="Firefox", slug="firefox", display_order=1, visible=True - ) - product_index = SingleProductIndexPage( - title="Firefox WT", slug="firefox", product=test_product - ) - product_dummy.add_child(instance=product_index) - - # See if it is now in the database - retrieved = Page.objects.get(id=product_index.id) - self.assertEqual(retrieved.title, "Firefox WT", "The titles should match") - self.assertEqual(retrieved.slug, "firefox", "The slugs should match") - - def test_can_serve_wt_product_index(self): - """Test that we can create a single product index page and serve it""" - homepage = Page.objects.get(url_path="/") - product_dummy = SumoPlaceholderPage(title="Product Dummy", slug="products") - homepage.add_child(instance=product_dummy) - test_product = ProductFactory( - title="Firefox", slug="firefox", display_order=1, visible=True - ) - product_index = SingleProductIndexPage( - title="Firefox WT", slug="firefox", product=test_product - ) - product_dummy.add_child(instance=product_index) - - # Serve the page - response = self.client.get("/en-US/products/firefox", follow=True) - self.assertEqual(response.status_code, 200, "The page should be served successfully") - - def test_placeholder_returns_404(self): - """Test that a placeholder page returns a 404""" - homepage = Page.objects.get(url_path="/") - product_dummy = SumoPlaceholderPage(title="Product Dummy", slug="products") - homepage.add_child(instance=product_dummy) - - # Try assertPageIsRenderable - dummy_page = Page.objects.get(id=product_dummy.id) - self.assertPageIsRenderable(dummy_page, accept_404=True) - - # Serve the page - request_factory = RequestFactory() - request = request_factory.get("/en-US/products/") - # Can't use test client here because it will follow the - # redirect and return a 200 - with self.assertRaises(Http404): - wagtail_serve(request, "/en-US/products/") diff --git a/kitsune/products/views.py b/kitsune/products/views.py index bbce691f1bd..bff13f20c67 100644 --- a/kitsune/products/views.py +++ b/kitsune/products/views.py @@ -7,7 +7,6 @@ from product_details import product_details from kitsune.products.models import Product, Topic, TopicSlugHistory -from kitsune.sumo.decorators import prefer_cms from kitsune.wiki.decorators import check_simple_wiki_locale from kitsune.wiki.facets import documents_for, topics_for from kitsune.wiki.models import Document, Revision @@ -23,7 +22,6 @@ def product_list(request): @check_simple_wiki_locale -@prefer_cms def product_landing(request, slug): """The product landing page.""" if slug == "firefox-accounts": diff --git a/kitsune/products/wagtail_hooks.py b/kitsune/products/wagtail_hooks.py deleted file mode 100644 index e6c31a29cfa..00000000000 --- a/kitsune/products/wagtail_hooks.py +++ /dev/null @@ -1,27 +0,0 @@ -from wagtail.admin.panels import FieldPanel - -from wagtail.snippets.models import register_snippet -from wagtail.snippets.views.snippets import SnippetViewSet - -from kitsune.products.models import Product - - -class ProductViewSet(SnippetViewSet): - model = Product - panels = [ - FieldPanel("title"), - FieldPanel("codename"), - FieldPanel("slug"), - FieldPanel("description"), - FieldPanel("image"), - FieldPanel("image_alternate"), - FieldPanel("display_order"), - FieldPanel("visible"), - FieldPanel("platforms"), - ] - - def get_preview_template(self, request, mode_name): - return "products/product_card_preview.html" - - -register_snippet(ProductViewSet) diff --git a/kitsune/settings.py b/kitsune/settings.py index 679131f535b..9606621f5af 100644 --- a/kitsune/settings.py +++ b/kitsune/settings.py @@ -9,7 +9,6 @@ import dj_database_url import django_cache_url from decouple import Csv, config -from wagtail.admin.localization import WAGTAILADMIN_PROVIDED_LANGUAGES from kitsune.lib.sumo_locales import LOCALES @@ -447,10 +446,6 @@ def immutable_file_test(path, url): "django_jinja.builtins.extensions.StaticFilesExtension", "django_jinja.builtins.extensions.DjangoFiltersExtension", "jinja2.ext.i18n", - "wagtail.jinja2tags.core", - "wagtail.admin.jinja2tags.userbar", - "wagtail.images.jinja2tags.images", - "wagtail.contrib.settings.jinja2tags.settings", ], "policies": { "ext.i18n.trimmed": True, @@ -515,7 +510,6 @@ def immutable_file_test(path, url): "kitsune.users.middleware.LogoutInvalidatedSessionsMiddleware", "csp.middleware.CSPMiddleware", "dockerflow.django.middleware.DockerflowMiddleware", - "wagtail.contrib.redirects.middleware.RedirectMiddleware", ) # SecurityMiddleware settings @@ -554,7 +548,6 @@ def immutable_file_test(path, url): AUTHENTICATION_BACKENDS = ("kitsune.sumo.readonlyauth.ReadOnlyBackend",) OIDC_ENABLE = False ENABLE_ADMIN = False - WAGTAIL_ENABLE_ADMIN = False else: OIDC_ENABLE = config("OIDC_ENABLE", default=True, cast=bool) ENABLE_ADMIN = config("ENABLE_ADMIN", default=OIDC_ENABLE, cast=bool) @@ -1315,51 +1308,3 @@ def filter_exceptions(event, hint): "MOZILLA_LOCATION_SERVICE", default="https://location.services.mozilla.com/v1/country?key=fa6d7fc9-e091-4be1-b6c1-5ada5815ae9d", # noqa ) - -# Wagtail settings -WAGTAIL_ENABLE = config("WAGTAIL_ENABLE", default=False, cast=bool) -WAGTAIL_ENABLE_ADMIN = config("WAGTAIL_ENABLE_ADMIN", default=False, cast=bool) -WAGTAIL_I18N_ENABLED = True -WAGTAIL_CONTENT_LANGUAGES = LANGUAGES -WAGTAILADMIN_PERMITTED_LANGUAGES = [ - # Only include items in this list that SuMO supports and that are included - # in wagtail.admin.localization.WAGTAILADMIN_PROVIDED_LANGUAGES. These are - # only used by Wagtail for localizing its admin interface. - ("ar", "Arabic"), - ("ca", "Catalan"), - ("cs", "Czech"), - ("de", "German"), - ("el", "Greek"), - ("en", "English"), - ("es", "Spanish"), - ("et", "Estonian"), - ("fi", "Finnish"), - ("fr", "French"), - ("gl", "Galician"), - ("hr", "Croatian"), - ("hu", "Hungarian"), - ("id-id", "Indonesian"), - ("it", "Italian"), - ("ja", "Japanese"), - ("ko", "Korean"), - ("lt", "Lithuanian"), - ("nl", "Dutch"), - ("fa", "Persian"), - ("pl", "Polish"), - ("pt-br", "Brazilian Portuguese"), - ("pt-pt", "Portuguese"), - ("ro", "Romanian"), - ("ru", "Russian"), - ("sv", "Swedish"), - ("sk-sk", "Slovak"), - ("sl", "Slovenian"), - ("th", "Thai"), - ("tr", "Turkish"), - ("uk", "Ukrainian"), - ("zh-hans", "Chinese (Simplified)"), - ("zh-hant", "Chinese (Traditional)"), -] -WAGTAIL_SITE_NAME = config("WAGTAIL_SITE_NAME", default="Mozilla Support CMS") -WAGTAILADMIN_BASE_URL = config("WAGTAILADMIN_BASE_URL", default="") -WAGTAILIMAGES_MAX_UPLOAD_SIZE = IMAGE_MAX_FILESIZE -WAGTAILDOCS_DOCUMENT_MODEL = "sumo.WagtailDocument" diff --git a/kitsune/sumo/decorators.py b/kitsune/sumo/decorators.py index 2ca797ca7c3..32ef0e23763 100644 --- a/kitsune/sumo/decorators.py +++ b/kitsune/sumo/decorators.py @@ -1,18 +1,12 @@ import json -import re from functools import wraps -from csp.utils import build_policy from django import http from django.conf import settings from django.core.exceptions import PermissionDenied -from django.http import Http404 from kitsune.sumo.utils import is_ratelimited -from wagtail.views import serve as wagtail_serve - - # Copy/pasta from from https://gist.github.com/1405096 # TODO: Log the hell out of the exceptions. JSON = "application/json" @@ -132,51 +126,3 @@ def wrapper(*args, **kwargs): return fn(*args, **kwargs) return wrapper - - -def csp_allow_inline_scripts_and_styles(fn): - """ - Add a CSP header to the response of the decorated view that allows inline - scripts and styles. The CSP header is created from the CSP values in the - settings, and then updated to include the "'unsafe-inline'" source within - both the "style-src" and "script-src" directives. The CSP header is inserted - in the response so that the normal insertion of the header within the - CSPMiddleware is bypassed. That, in turn, prevents the CSPMiddleware from - adding the nonce sources, which would override the "'unsafe-inline'" sources - and effectively cause them to be ignored. - """ - - @wraps(fn) - def wrapped(*args, **kwargs): - response = fn(*args, **kwargs) - response["Content-Security-Policy"] = build_policy( - update={ - "style-src": "'unsafe-inline'", - "script-src": "'unsafe-inline'", - } - ) - return response - - return wrapped - - -def remove_locale(url): - # Define the regex pattern for locale (e.g., /en-US/ or /en-us/) - locale_pattern = r"^/([a-z]{2}(-[a-zA-Z]{2})?)/" - # Remove the locale part - return re.sub(locale_pattern, "/", url) - - -def prefer_cms(view_func): - @wraps(view_func) - def _wrapped_view(request, *args, **kwargs): - path = remove_locale(request.path_info) - try: - wagtail_response = wagtail_serve(request, path) - if wagtail_response.status_code == 200: - return wagtail_response - except Http404: - pass # Continue to the original view if no Wagtail page is found - return view_func(request, *args, **kwargs) - - return _wrapped_view diff --git a/kitsune/sumo/migrations/0004_delete_wagtaildocument.py b/kitsune/sumo/migrations/0004_delete_wagtaildocument.py new file mode 100644 index 00000000000..b909e3d986c --- /dev/null +++ b/kitsune/sumo/migrations/0004_delete_wagtaildocument.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.16 on 2024-10-14 03:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("sumo", "0003_initial"), + ] + + operations = [ + migrations.DeleteModel( + name="WagtailDocument", + ), + ] diff --git a/kitsune/sumo/models/models.py b/kitsune/sumo/models.py similarity index 100% rename from kitsune/sumo/models/models.py rename to kitsune/sumo/models.py diff --git a/kitsune/sumo/models/__init__.py b/kitsune/sumo/models/__init__.py deleted file mode 100644 index 477cc368db5..00000000000 --- a/kitsune/sumo/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .models import LocaleField, ModelBase # noqa -from .pages import WagtailDocument # noqa diff --git a/kitsune/sumo/models/pages.py b/kitsune/sumo/models/pages.py deleted file mode 100644 index 31d51a06fd3..00000000000 --- a/kitsune/sumo/models/pages.py +++ /dev/null @@ -1,5 +0,0 @@ -from wagtail.documents.models import AbstractDocument - - -class WagtailDocument(AbstractDocument): - pass diff --git a/kitsune/sumo/templates/wagtailadmin/404.html b/kitsune/sumo/templates/wagtailadmin/404.html deleted file mode 100644 index 1155b9b907e..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/404.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "wagtailadmin/404.html" %} -{% load sumo_tags %} - -{% block branding_logo %} - {{ _( -{% endblock %} diff --git a/kitsune/sumo/templates/wagtailadmin/admin_base.html b/kitsune/sumo/templates/wagtailadmin/admin_base.html deleted file mode 100644 index cff1517d840..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/admin_base.html +++ /dev/null @@ -1,63 +0,0 @@ -{% extends "wagtailadmin/admin_base.html" %} -{% load i18n wagtailadmin_tags %} -{% load sumo_tags %} - -{% block branding_favicon %} - -{% endblock %} - -{% block branding_title %}{{ _("Mozilla Support") }}{% endblock %} - -{% block extra_css %} - {% include "entrypoints/wagtail.html" %} -{% endblock %} - -{% block js %} - - {% wagtail_config as config %} - {{ config|json_script:"wagtail-config" }} - - - - - - - - - - - - - - - {% hook_output 'insert_global_admin_js' %} - - {% block extra_js %}{% endblock %} -{% endblock %} diff --git a/kitsune/sumo/templates/wagtailadmin/base.html b/kitsune/sumo/templates/wagtailadmin/base.html deleted file mode 100644 index 84a5e1a1440..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/base.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "wagtailadmin/base.html" %} -{% load sumo_tags %} - -{% block branding_logo %} - {{ _( -{% endblock %} diff --git a/kitsune/sumo/templates/wagtailadmin/home.html b/kitsune/sumo/templates/wagtailadmin/home.html deleted file mode 100644 index 2e3710cec4c..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/home.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "wagtailadmin/home.html" %} -{% load i18n %} - -{% block branding_welcome %} -{{ _("Welcome to the Mozilla Support CMS") }} -{% endblock %} diff --git a/kitsune/sumo/templates/wagtailadmin/login.html b/kitsune/sumo/templates/wagtailadmin/login.html deleted file mode 100644 index 54101e08b78..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/login.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "wagtailadmin/admin_base.html" %} -{% load i18n wagtailadmin_tags sumo_tags %} -{% block titletag %}{{ _("Sign in") }}{% endblock %} -{% block bodyclass %}login{% endblock %} - -{% block furniture %} -
-

- {% block branding_login %} - {{ _("Mozilla Support CMS") }} - {% endblock %} -

- -
- {# Always show messages div so it can be appended to by JS #} - {% if messages %} - - {% endif %} -
- - {% block above_login %}{% endblock %} - -

- {{ _("Sign in via SSO") }} -

- - {% block below_login %}{% endblock %} - - {% block branding_logo %} - - {% endblock %} -
-{% endblock %} diff --git a/kitsune/sumo/templates/wagtailadmin/shared/icons.html b/kitsune/sumo/templates/wagtailadmin/shared/icons.html deleted file mode 100644 index ecb90a8114a..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/shared/icons.html +++ /dev/null @@ -1,9 +0,0 @@ -{% spaceless %} -
- - - {{ icons|safe }} - - -
-{% endspaceless %} diff --git a/kitsune/sumo/templates/wagtailadmin/userbar/base.html b/kitsune/sumo/templates/wagtailadmin/userbar/base.html deleted file mode 100644 index f76b819e38e..00000000000 --- a/kitsune/sumo/templates/wagtailadmin/userbar/base.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "wagtailadmin/userbar/base.html" %} -{% load sumo_tags %} - -{% block branding_logo %} - {{ _( -{% endblock %} diff --git a/kitsune/sumo/views.py b/kitsune/sumo/views.py index e516fc95c1e..d3c75ea9be4 100644 --- a/kitsune/sumo/views.py +++ b/kitsune/sumo/views.py @@ -11,7 +11,7 @@ JsonResponse, ) from django.middleware.csrf import get_token -from django.shortcuts import redirect, render +from django.shortcuts import render from django.utils import translation from django.utils.translation import gettext as _ from django.views.decorators.cache import never_cache @@ -151,12 +151,3 @@ def serve_cors(*args, **kwargs): from django.views.static import serve return serve(*args, **kwargs) - - -def cms_login(request): - """The login view for the Wagtail CMS.""" - # If user is already logged-in and has permission, redirect them to the CMS dashboard. - if request.user.is_authenticated and request.user.has_perm("wagtailadmin.access_admin"): - return redirect(get_next_url(request) or reverse("wagtailadmin_home")) - - return render(request, "wagtailadmin/login.html") diff --git a/kitsune/urls.py b/kitsune/urls.py index 037874e0e96..00fcd7db138 100644 --- a/kitsune/urls.py +++ b/kitsune/urls.py @@ -5,13 +5,9 @@ from django.views.static import serve as servestatic from graphene_django.views import GraphQLView from waffle.views import wafflejs -from wagtail import urls as wagtail_urls -from wagtail.admin.urls import urlpatterns as wagtail_admin_urlpatterns -from wagtail.utils.urlpatterns import decorate_urlpatterns from kitsune.dashboards.api import WikiMetricList from kitsune.sumo import views as sumo_views -from kitsune.sumo.decorators import csp_allow_inline_scripts_and_styles from kitsune.sumo.i18n import i18n_patterns # Note: This must come before importing admin because it patches the @@ -38,7 +34,6 @@ path("announcements/", include("kitsune.announcements.urls")), path("community/", include("kitsune.community.urls")), path("badges/", include("kitsune.kbadge.urls")), - path("documents/", include("wagtail.documents.urls")), path("locales", sumo_views.locales, name="sumo.locales"), path("", include("kitsune.products.urls")), path("", include("kitsune.dashboards.urls")), @@ -51,21 +46,6 @@ if settings.OIDC_ENABLE: urlpatterns.append(path("", include("kitsune.users.urls_oidc"))) -if settings.WAGTAIL_ENABLE_ADMIN: - urlpatterns.append(path("cms/login/", sumo_views.cms_login, name="wagtailadmin_login")) - urlpatterns.append( - path( - "cms/", - include( - decorate_urlpatterns( - wagtail_admin_urlpatterns, csp_allow_inline_scripts_and_styles - ) - ), - ) - ) - -if settings.WAGTAIL_ENABLE: - urlpatterns += i18n_patterns(path("", include(wagtail_urls))) urlpatterns += [ path("1/", include("kitsune.inproduct.urls")), diff --git a/poetry.lock b/poetry.lock index ccd67686cbf..d7637193bd0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5003,13 +5003,13 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [[package]] name = "wagtail" -version = "6.1.3" +version = "6.2.2" description = "A Django content management system." optional = false python-versions = ">=3.8" files = [ - {file = "wagtail-6.1.3-py3-none-any.whl", hash = "sha256:b6c4d5705adf51a5e49ea416032dd0a6534588fc31c5c9a95f698e6ddec0a203"}, - {file = "wagtail-6.1.3.tar.gz", hash = "sha256:8f4908ab1b6b963a8aa7adf8f0ec738cd1dc79b9816c6d5f59018f600a404378"}, + {file = "wagtail-6.2.2-py3-none-any.whl", hash = "sha256:d0382603aef5d7e4a46529aa125857774a317c2870c9b6836767932969829429"}, + {file = "wagtail-6.2.2.tar.gz", hash = "sha256:506ac2b59dae85069ae754b45bc13b91cbd86e92d4f5d663658773b0ed7a16b9"}, ] [package.dependencies] @@ -5019,7 +5019,7 @@ Django = ">=4.2,<6.0" django-filter = ">=23.3,<25" django-modelcluster = ">=6.2.1,<7.0" django-permissionedforms = ">=0.1,<1.0" -django-taggit = ">=4.0,<5.1" +django-taggit = ">=5.0,<5.1" django-treebeard = ">=4.5.1,<5.0" djangorestframework = ">=3.15.1,<4.0" draftjs-exporter = ">=2.1.5,<6.0" @@ -5032,7 +5032,7 @@ telepath = ">=0.3.1,<1" Willow = {version = ">=1.8.0,<2", extras = ["heif"]} [package.extras] -docs = ["Sphinx (>=1.5.2)", "myst-parser (==2.0.0)", "pyenchant (>=3.1.1,<4)", "sphinx-autobuild (>=0.6.0)", "sphinx-copybutton (>=0.5,<1.0)", "sphinx-wagtail-theme (==6.3.0)", "sphinxcontrib-spelling (>=7,<8)"] +docs = ["Sphinx (>=7.0)", "myst-parser (==2.0.0)", "pyenchant (>=3.1.1,<4)", "sphinx-autobuild (>=0.6.0)", "sphinx-copybutton (>=0.5,<1.0)", "sphinx-wagtail-theme (==6.3.0)", "sphinxcontrib-spelling (>=7,<8)"] testing = ["Jinja2 (>=3.0,<3.2)", "azure-mgmt-cdn (>=12.0,<13.0)", "azure-mgmt-frontdoor (>=1.0,<1.1)", "boto3 (>=1.28,<2)", "coverage (>=3.7.0)", "curlylint (==0.13.1)", "django-pattern-library (>=0.7)", "djhtml (==3.0.6)", "doc8 (==0.8.1)", "factory-boy (>=3.2)", "freezegun (>=0.3.8)", "polib (>=1.1,<2.0)", "python-dateutil (>=2.7)", "pytz (>=2014.7)", "ruff (==0.1.5)", "semgrep (==1.40.0)", "tblib (>=2.0,<3.0)"] [[package]] @@ -5362,4 +5362,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "e53420ab41b77037f210be0d958e7f4d8a4642f76445f2f56afce3547784bb0d" +content-hash = "8d55513b8828663aad4b50c78c5b9fed62ed244441d570d7808ce1c2f5caa701" diff --git a/pyproject.toml b/pyproject.toml index 7ac00968efa..f271ae3ca4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,7 @@ mkdocs-material = "^9.5.3" dockerflow = "^2022.8.0" google-analytics-data = "0.18.7" pyparsing = "3.1.2" -wagtail = "6.1.3" +wagtail = "6.2.2" wagtail-localize = "1.9" django-silk = "^5.1.0" requests = "^2.32.3" diff --git a/webpack/entrypoints-html.js b/webpack/entrypoints-html.js index a552aa1c91d..ad2a018ce85 100644 --- a/webpack/entrypoints-html.js +++ b/webpack/entrypoints-html.js @@ -10,8 +10,8 @@ module.exports = Object.keys(entrypoints).map(entry => chunks: [entry], inject: false, scriptLoading: "defer", - templateContent: ({htmlWebpackPlugin}) => { - if ((entry == "screen") || (entry == "wagtail")) { + templateContent: ({ htmlWebpackPlugin }) => { + if (entry == "screen") { return ``; } // inject nonce in the script for django-csp to populate diff --git a/webpack/entrypoints.js b/webpack/entrypoints.js index 1f412b10353..70daac05e39 100644 --- a/webpack/entrypoints.js +++ b/webpack/entrypoints.js @@ -1,6 +1,5 @@ const entrypoints = { screen: ["sumo/scss/screen.scss"], - wagtail: ["sumo/scss/wagtail.scss"], common: [ "sumo/js/i18n.js", "sumo/js/kbox.js",