Initial commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<div class="rich-text">{{ html|safe }}</div>
|
||||
0
env/lib/python3.10/site-packages/wagtail/contrib/legacy/richtext/tests/__init__.py
vendored
Normal file
0
env/lib/python3.10/site-packages/wagtail/contrib/legacy/richtext/tests/__init__.py
vendored
Normal file
Binary file not shown.
Binary file not shown.
14
env/lib/python3.10/site-packages/wagtail/contrib/legacy/richtext/tests/test_templatetag.py
vendored
Normal file
14
env/lib/python3.10/site-packages/wagtail/contrib/legacy/richtext/tests/test_templatetag.py
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.templatetags.wagtailcore_tags import richtext
|
||||
|
||||
|
||||
class TestTemplateTag(TestCase):
|
||||
def test_no_contrib_legacy_richtext_no_wrapper(self):
|
||||
self.assertEqual(richtext("Foo"), "Foo")
|
||||
|
||||
def test_contrib_legacy_richtext_renders_wrapper(self):
|
||||
with self.modify_settings(
|
||||
INSTALLED_APPS={"prepend": "wagtail.contrib.legacy.richtext"}
|
||||
):
|
||||
self.assertEqual(richtext("Foo"), """<div class="rich-text">Foo</div>""")
|
||||
15
env/lib/python3.10/site-packages/wagtail/contrib/legacy/sitemiddleware/__init__.py
vendored
Normal file
15
env/lib/python3.10/site-packages/wagtail/contrib/legacy/sitemiddleware/__init__.py
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
from wagtail.models import Site
|
||||
|
||||
|
||||
class SiteMiddleware(MiddlewareMixin):
|
||||
def process_request(self, request):
|
||||
"""
|
||||
Set request.site to contain the Site object responsible for handling this request,
|
||||
according to hostname matching rules
|
||||
"""
|
||||
try:
|
||||
request.site = Site.find_for_request(request)
|
||||
except Site.DoesNotExist:
|
||||
request.site = None
|
||||
Binary file not shown.
Reference in New Issue
Block a user