From 5a634a218077916faa8a3f1b6facc04ba7c7939f Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sat, 29 Aug 2020 13:00:31 +0200 Subject: [PATCH 1/8] Apply code style fixes Fix all code style issues signaled by flake8 mpicms/ --- mpicms/base/apps.py | 2 +- mpicms/base/blocks.py | 6 +++--- mpicms/base/models.py | 3 +++ mpicms/base/signals.py | 4 ++-- mpicms/base/templatetags/base_tags.py | 14 ++++++++------ mpicms/base/templatetags/md_tags.py | 1 + mpicms/base/translation.py | 7 ++++++- mpicms/base/wagtail_hooks.py | 13 ++++++++++--- mpicms/events/views.py | 2 +- mpicms/personal/models.py | 2 +- mpicms/personal/wagtail_hooks.py | 3 ++- mpicms/users/wagtail_hooks.py | 2 +- 12 files changed, 39 insertions(+), 20 deletions(-) diff --git a/mpicms/base/apps.py b/mpicms/base/apps.py index 2b327fc..985fc48 100644 --- a/mpicms/base/apps.py +++ b/mpicms/base/apps.py @@ -6,4 +6,4 @@ class BaseAppConfig(AppConfig): verbose_name = "Base" def ready(self): - import mpicms.base.signals + import mpicms.base.signals # noqa: F401 diff --git a/mpicms/base/blocks.py b/mpicms/base/blocks.py index 819c3d3..41dee5f 100644 --- a/mpicms/base/blocks.py +++ b/mpicms/base/blocks.py @@ -42,7 +42,7 @@ class MenuBlock(blocks.StructBlock): ('url', blocks.URLBlock(label=_('URL'))) ], label=_('Items')) ) - + class Meta: - icon = 'list-ul' - label = _('Menu') \ No newline at end of file + icon = 'list-ul' + label = _('Menu') diff --git a/mpicms/base/models.py b/mpicms/base/models.py index c6522cf..abccb72 100644 --- a/mpicms/base/models.py +++ b/mpicms/base/models.py @@ -126,6 +126,7 @@ class Meta: # noqa verbose_name = _("wiki page") verbose_name_plural = _("wiki pages") + class PhonelistPage(BasePage): content_panels = Page.content_panels promote_panels = Page.promote_panels @@ -143,9 +144,11 @@ def serve(self, request, *args, **kwargs): def serve_preview(self, request, mode_name): return ContactListView.as_view()(request) + class FormField(AbstractFormField): page = ParentalKey('FormPage', on_delete=models.CASCADE, related_name='form_fields') + class FormPage(AbstractEmailForm, SideBarMixin, BasePage): intro = RichTextField(blank=True) thank_you_text = RichTextField(blank=True) diff --git a/mpicms/base/signals.py b/mpicms/base/signals.py index 2d62081..03e3976 100644 --- a/mpicms/base/signals.py +++ b/mpicms/base/signals.py @@ -16,10 +16,10 @@ def notify_user(sender, instance, action, model, pk_set, **kwargs): groups = ', '.join([group.__str__() for group in model.objects.filter(pk__in=pk_set)]) send_mail( f'You have been added to {groups}', - f'An admin has added you to the following group/groups: {groups}. You are now granted all associated permissons.', + f'An admin has added you to the following group/groups: {groups}.' + f' You are now granted all associated permissons.', settings.DEFAULT_FROM_EMAIL, [instance.email], fail_silently=True, ) logger.debug(f'User {instance} added to {groups}. Email sent out.') - diff --git a/mpicms/base/templatetags/base_tags.py b/mpicms/base/templatetags/base_tags.py index 5df90d4..d6ee1b2 100644 --- a/mpicms/base/templatetags/base_tags.py +++ b/mpicms/base/templatetags/base_tags.py @@ -21,7 +21,7 @@ def is_subscribed(page, user): @register.filter def remove_i18n(url): if url.startswith('/en') or url.startswith('/de'): - return url[3:] + return url[3:] return url @@ -41,15 +41,16 @@ def remove_i18n(url): r"|HS\d\d" r"|GH[01]\d" r"|[K0123]\.[1234]\.F?\d\d" - r"|SR ?([1234])" ) + r"|SR ?([1234])") -SR_MAP= { +SR_MAP = { "1": "0.3.73", "2": "0.3.05", "3": "0.3.06", "4": "0.2.01", } + def room_match_to_link(match): room = match.group(0) target_room = room @@ -59,9 +60,10 @@ def room_match_to_link(match): target_room = SR_MAP[sr_number] return '' + room + '' + @register.filter(needs_autoescape=True) @stringfilter def add_room_links(rooms, autoescape=True): - if autoescape: - rooms = conditional_escape(rooms) - return mark_safe(ROOM_PATTERN.sub(room_match_to_link, rooms)) + if autoescape: + rooms = conditional_escape(rooms) + return mark_safe(ROOM_PATTERN.sub(room_match_to_link, rooms)) diff --git a/mpicms/base/templatetags/md_tags.py b/mpicms/base/templatetags/md_tags.py index 9b78149..6e90a59 100644 --- a/mpicms/base/templatetags/md_tags.py +++ b/mpicms/base/templatetags/md_tags.py @@ -12,6 +12,7 @@ register = template.Library() md_processor = None + @register.filter def markdown(text): global md_processor diff --git a/mpicms/base/translation.py b/mpicms/base/translation.py index 1d247a9..f54fbdf 100644 --- a/mpicms/base/translation.py +++ b/mpicms/base/translation.py @@ -9,7 +9,7 @@ from .models import ( WikiPage, RootPage, HomePage, FeaturedImage, PhonelistPage, - FormPage, FormField, + FormPage, ) @@ -20,6 +20,7 @@ class FeaturedImageTR(TranslationOptions): 'text' ) + @register(RootPage) class RootPageTR(TranslationOptions): fields = { @@ -27,6 +28,7 @@ class RootPageTR(TranslationOptions): 'quick_links' } + @register(HomePage) class HomePageTR(TranslationOptions): fields = ( @@ -34,6 +36,7 @@ class HomePageTR(TranslationOptions): 'sidebar' ) + @register(WikiPage) class WikiPageTR(TranslationOptions): fields = ( @@ -41,11 +44,13 @@ class WikiPageTR(TranslationOptions): 'sidebar' ) + @register(PhonelistPage) class PhonelistPageTR(TranslationOptions): fields = ( ) + @register(FormPage) class FormPageTR(TranslationOptions): fields = ( diff --git a/mpicms/base/wagtail_hooks.py b/mpicms/base/wagtail_hooks.py index 0dd1963..cfe80df 100644 --- a/mpicms/base/wagtail_hooks.py +++ b/mpicms/base/wagtail_hooks.py @@ -37,17 +37,22 @@ def register_h1_feature(features): @hooks.register('register_admin_menu_item') def register_site_button(): - return MenuItem(_('View website'), '/?', classnames='icon icon-site', order=1) # Without the ? Wagtail applies different CSS + # Without the ? Wagtail applies different CSS + return MenuItem(_('View website'), '/?', classnames='icon icon-site', order=1) + @hooks.register('after_edit_page') def send_notifications(request, page): subscribers = [user.email for user in page.subscribers.exclude(id=request.user.id)] if subscribers: - html_message = f'''View changes\n + html_message = f'''\ +View changes + Edited by {request.user}. You are receiving this message because you subscribed to updates for page {page.get_admin_display_title()}. -Log in to the admin interface and click here to unsubscribe.''' +Log in to the admin interface and click here to unsubscribe.''' send_mail( f'Page {page.get_admin_display_title()} edited.', @@ -58,10 +63,12 @@ def send_notifications(request, page): fail_silently=True) logger.debug(f'Send change notification to {subscribers}') + @hooks.register('construct_page_action_menu') def remove_submit_to_moderator_option(menu_items, request, context): menu_items[:] = [item for item in menu_items if item.name != 'action-submit'] + class FeaturedImageAdmin(ModelAdmin): model = FeaturedImage menu_label = _('Featured Images') diff --git a/mpicms/events/views.py b/mpicms/events/views.py index 6497e73..bbf5b98 100644 --- a/mpicms/events/views.py +++ b/mpicms/events/views.py @@ -5,6 +5,6 @@ def ics_view(request): index = EventIndex.objects.first() - response = HttpResponse(index.ics, content_type="text/calendar") + response = HttpResponse(index.ics, content_type="text/calendar") response["Content-disposition"] = "attachment; filename=calendar.ics" return response diff --git a/mpicms/personal/models.py b/mpicms/personal/models.py index c7c87a4..e7c8035 100644 --- a/mpicms/personal/models.py +++ b/mpicms/personal/models.py @@ -106,7 +106,7 @@ class Contact(index.Indexed, ClusterableModel): objects = ContactManager() panels = [ - MultiFieldPanel([ + MultiFieldPanel([ FieldPanel('title', classname=''), FieldPanel('first_name'), FieldPanel('last_name'), diff --git a/mpicms/personal/wagtail_hooks.py b/mpicms/personal/wagtail_hooks.py index c82d654..d82fd56 100644 --- a/mpicms/personal/wagtail_hooks.py +++ b/mpicms/personal/wagtail_hooks.py @@ -49,7 +49,8 @@ def get_groups(self, obj): get_groups.short_description = _('Groups') def get_positions(self, obj): - return ", ".join([position.__str__() for position in Position.objects.filter(contacts__in=obj.positions.all()).distinct()]) + return ", ".join([position.__str__() for position in + Position.objects.filter(contacts__in=obj.positions.all()).distinct()]) get_groups.short_description = _('Positions') def get_queryset(self, request): diff --git a/mpicms/users/wagtail_hooks.py b/mpicms/users/wagtail_hooks.py index 65ed6a3..88d812b 100644 --- a/mpicms/users/wagtail_hooks.py +++ b/mpicms/users/wagtail_hooks.py @@ -2,7 +2,7 @@ from wagtail.core import hooks -from . import urls +from . import urls @hooks.register('register_admin_urls') From 10a62c99a9a3bbadd0de81dfeb95d0a9374a2dda Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 1 Sep 2020 13:42:42 +0200 Subject: [PATCH 2/8] users: Remove wagtail_hooks Remove call to register_admin_urls, because it seems redundant. mpicms.users.urls is also included via config.urlpatterns. --- mpicms/users/wagtail_hooks.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 mpicms/users/wagtail_hooks.py diff --git a/mpicms/users/wagtail_hooks.py b/mpicms/users/wagtail_hooks.py deleted file mode 100644 index 88d812b..0000000 --- a/mpicms/users/wagtail_hooks.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.conf.urls import include, url - -from wagtail.core import hooks - -from . import urls - - -@hooks.register('register_admin_urls') -def register_admin_urls(): - return [ - url(r'^users/', include(urls, namespace='wagtailusers_users')), - ] From b8d7f214e70f02213e107fe2056b1f575e3b5d18 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 1 Sep 2020 13:48:25 +0200 Subject: [PATCH 3/8] users: Change app namespace The app namespace wagtailusers_users is already taken by the unmodified wagtail admin app. So we get a warning ?: (urls.W005) URL namespace 'wagtailusers_users' isn't unique. You may not be able to reverse all URLs in this namespace on startup. Our modified users app doesn't need to use the same app namespace. Even if a template uses wagtailusrs_users:something, it would resolve to a url which we mapped. --- mpicms/users/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpicms/users/urls.py b/mpicms/users/urls.py index 255c5f2..5acfa7b 100644 --- a/mpicms/users/urls.py +++ b/mpicms/users/urls.py @@ -6,7 +6,7 @@ from .views import edit -app_name = 'wagtailusers_users' +app_name = 'mpicms_users' urlpatterns = [ re_path(r'^$', users.index, name='index'), re_path(r'^add/$', default_views.page_not_found, From 72b794ce88ba6f86ceff6408d0bf28288c6b0b90 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 1 Sep 2020 14:39:27 +0200 Subject: [PATCH 4/8] users: Simplify masking of disabled functions Change from django.defaults.page_not_found view with complicated semantics to raise django.http.Http404. --- mpicms/users/urls.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mpicms/users/urls.py b/mpicms/users/urls.py index 5acfa7b..52cd191 100644 --- a/mpicms/users/urls.py +++ b/mpicms/users/urls.py @@ -1,16 +1,20 @@ from django.urls import re_path -from django.views import defaults as default_views +from django.http import Http404 from wagtail.users.views import users from .views import edit +def forbidden_view(request): + raise Http404("disabled") + + app_name = 'mpicms_users' + urlpatterns = [ re_path(r'^$', users.index, name='index'), - re_path(r'^add/$', default_views.page_not_found, - kwargs={"exception": Exception("Page not Found")}, name='add'), + re_path(r'^add/$', forbidden_view), re_path(r'^([^\/]+)/$', edit, name='edit'), - re_path(r'^([^\/]+)/delete/$', default_views.page_not_found, name='delete'), + re_path(r'^([^\/]+)/delete/$', forbidden_view), ] From 85cee87ad04b59986faf98e7a7ab3aa841748643 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 1 Sep 2020 15:18:53 +0200 Subject: [PATCH 5/8] users; Remove index view It doesn't seem necessary to register wagtail.users.views.index, because it is already there. So don't do it. --- mpicms/users/urls.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/mpicms/users/urls.py b/mpicms/users/urls.py index 52cd191..275bd9d 100644 --- a/mpicms/users/urls.py +++ b/mpicms/users/urls.py @@ -1,8 +1,6 @@ from django.urls import re_path from django.http import Http404 -from wagtail.users.views import users - from .views import edit @@ -13,7 +11,6 @@ def forbidden_view(request): app_name = 'mpicms_users' urlpatterns = [ - re_path(r'^$', users.index, name='index'), re_path(r'^add/$', forbidden_view), re_path(r'^([^\/]+)/$', edit, name='edit'), re_path(r'^([^\/]+)/delete/$', forbidden_view), From fb469255a354b80281d8c512681495b936980836 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 16 Sep 2020 12:23:27 +0200 Subject: [PATCH 6/8] Requirements: Use wagtail-modeltranslation variant Use branch add-toggle-configure from our clone of wagtail-modeltranslation until its PR [1] is decided. [1] https://github.com/infoportugal/wagtail-modeltranslation/pull/301 --- requirements/base.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.in b/requirements/base.in index 45594a4..ec5640a 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -6,7 +6,7 @@ psycopg2-binary # Wagtail wagtail -wagtail-modeltranslation +git+https://github.com/buczek/wagtail-modeltranslation.git@add-toggle-configure markdown pygments From 663a5dc5c85f5b46bf4869621a4d61ba4e4ad57f Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 16 Sep 2020 12:29:01 +0200 Subject: [PATCH 7/8] Update requirements Update python requirements with (cd requirements; make) The virtual environment can be update to the specified versions with pip-sync requirements/dev.txt --- requirements/base.txt | 16 ++--- requirements/dev.txt | 138 ++++++++++++++++++------------------ requirements/production.txt | 94 ++++++++++++------------ requirements/test.txt | 104 +++++++++++++-------------- 4 files changed, 176 insertions(+), 176 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index cfb7408..91e7ff3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -9,29 +9,29 @@ asgiref==3.2.10 # via django beautifulsoup4==4.8.2 # via wagtail certifi==2020.6.20 # via requests chardet==3.0.4 # via requests -django-auth-ldap==2.2.0 +django-auth-ldap==2.2.0 # via -r base.in django-filter==2.3.0 # via wagtail django-modelcluster==5.0.2 # via wagtail django-modeltranslation==0.15.1 # via wagtail-modeltranslation django-taggit==1.3.0 # via wagtail django-treebeard==4.3.1 # via wagtail -django==3.1 +django==3.1 # via -r base.in, django-auth-ldap, django-filter, django-modeltranslation, django-taggit, django-treebeard, djangorestframework, wagtail djangorestframework==3.11.1 # via wagtail draftjs-exporter==2.1.7 # via wagtail et-xmlfile==1.0.1 # via openpyxl html5lib==1.1 # via wagtail -ics==0.7 +ics==0.7 # via -r base.in idna==2.10 # via requests importlib-metadata==1.7.0 # via markdown jdcal==1.4.1 # via openpyxl l18n==2018.5 # via wagtail -markdown==3.2.2 +markdown==3.2.2 # via -r base.in openpyxl==3.0.4 # via tablib pillow==7.2.0 # via wagtail -psycopg2-binary==2.8.5 +psycopg2-binary==2.8.5 # via -r base.in pyasn1-modules==0.2.8 # via python-ldap pyasn1==0.4.8 # via pyasn1-modules, python-ldap -pygments==2.6.1 +pygments==2.6.1 # via -r base.in python-dateutil==2.8.1 # via arrow, ics python-ldap==3.3.1 # via django-auth-ldap pytz==2020.1 # via django, django-modelcluster, l18n @@ -43,8 +43,8 @@ tablib[xls,xlsx]==2.0.0 # via wagtail tatsu==4.4.0 # via ics unidecode==1.1.1 # via wagtail urllib3==1.25.10 # via requests -wagtail-modeltranslation==0.10.13 -wagtail==2.10 +git+https://github.com/buczek/wagtail-modeltranslation.git@add-toggle-configure # via -r base.in +wagtail==2.10 # via -r base.in, wagtail-modeltranslation webencodings==0.5.1 # via html5lib willow==1.4 # via wagtail xlrd==1.2.0 # via tablib diff --git a/requirements/dev.txt b/requirements/dev.txt index bfa89fe..28bd067 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,97 +4,97 @@ # # pip-compile --output-file=dev.txt dev.in # -arrow==0.14.7 -asgiref==3.2.10 +arrow==0.14.7 # via -r ./test.txt, ics +asgiref==3.2.10 # via -r ./test.txt, django astroid==2.4.2 # via pylint -attrs==19.3.0 +attrs==19.3.0 # via -r ./test.txt, pytest backcall==0.2.0 # via ipython -beautifulsoup4==4.8.2 -certifi==2020.6.20 -chardet==3.0.4 +beautifulsoup4==4.8.2 # via -r ./test.txt, wagtail +certifi==2020.6.20 # via -r ./test.txt, requests +chardet==3.0.4 # via -r ./test.txt, requests click==7.1.2 # via pip-tools -coverage==5.2.1 +coverage==5.2.1 # via -r ./test.txt, django-coverage-plugin decorator==4.4.2 # via ipython, traitlets -django-auth-ldap==2.2.0 -django-coverage-plugin==1.8.0 -django-debug-toolbar==2.2 -django-filter==2.3.0 -django-modelcluster==5.0.2 -django-modeltranslation==0.15.1 -django-taggit==1.3.0 -django-treebeard==4.3.1 -django==3.1 -djangorestframework==3.11.1 -draftjs-exporter==2.1.7 -et-xmlfile==1.0.1 -factory-boy==2.12.0 +django-auth-ldap==2.2.0 # via -r ./test.txt +django-coverage-plugin==1.8.0 # via -r ./test.txt +django-debug-toolbar==2.2 # via -r dev.in +django-filter==2.3.0 # via -r ./test.txt, wagtail +django-modelcluster==5.0.2 # via -r ./test.txt, wagtail +django-modeltranslation==0.15.1 # via -r ./test.txt, wagtail-modeltranslation +django-taggit==1.3.0 # via -r ./test.txt, wagtail +django-treebeard==4.3.1 # via -r ./test.txt, wagtail +django==3.1 # via -r ./test.txt, django-auth-ldap, django-debug-toolbar, django-filter, django-modeltranslation, django-taggit, django-treebeard, djangorestframework, wagtail +djangorestframework==3.11.1 # via -r ./test.txt, wagtail +draftjs-exporter==2.1.7 # via -r ./test.txt, wagtail +et-xmlfile==1.0.1 # via -r ./test.txt, openpyxl +factory-boy==2.12.0 # via -r dev.in faker==4.1.1 # via factory-boy -flake8==3.8.3 -html5lib==1.1 -ics==0.7 -idna==2.10 -importlib-metadata==1.7.0 -iniconfig==1.0.1 -ipdb==0.13.3 +flake8==3.8.3 # via -r ./test.txt +html5lib==1.1 # via -r ./test.txt, wagtail +ics==0.7 # via -r ./test.txt +idna==2.10 # via -r ./test.txt, requests +importlib-metadata==1.7.0 # via -r ./test.txt, flake8, markdown, pluggy, pytest +iniconfig==1.0.1 # via -r ./test.txt, pytest +ipdb==0.13.3 # via -r dev.in ipython-genutils==0.2.0 # via traitlets ipython==7.17.0 # via ipdb isort==4.3.21 # via pylint -jdcal==1.4.1 +jdcal==1.4.1 # via -r ./test.txt, openpyxl jedi==0.17.2 # via ipython -l18n==2018.5 +l18n==2018.5 # via -r ./test.txt, wagtail lazy-object-proxy==1.4.3 # via astroid -markdown==3.2.2 -mccabe==0.6.1 -more-itertools==8.4.0 -openpyxl==3.0.4 -packaging==20.4 +markdown==3.2.2 # via -r ./test.txt +mccabe==0.6.1 # via -r ./test.txt, flake8, pylama, pylint +more-itertools==8.4.0 # via -r ./test.txt, pytest +openpyxl==3.0.4 # via -r ./test.txt, tablib +packaging==20.4 # via -r ./test.txt, pytest parso==0.7.1 # via jedi pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pillow==7.2.0 -pip-tools==5.3.1 -pluggy==0.13.1 +pillow==7.2.0 # via -r ./test.txt, wagtail +pip-tools==5.3.1 # via -r dev.in +pluggy==0.13.1 # via -r ./test.txt, pytest prompt-toolkit==3.0.6 # via ipython -psycopg2-binary==2.8.5 +psycopg2-binary==2.8.5 # via -r ./test.txt ptyprocess==0.6.0 # via pexpect -py==1.9.0 -pyasn1-modules==0.2.8 -pyasn1==0.4.8 -pycodestyle==2.6.0 +py==1.9.0 # via -r ./test.txt, pytest +pyasn1-modules==0.2.8 # via -r ./test.txt, python-ldap +pyasn1==0.4.8 # via -r ./test.txt, pyasn1-modules, python-ldap +pycodestyle==2.6.0 # via -r ./test.txt, flake8, pylama pydocstyle==5.0.2 # via pylama -pyflakes==2.2.0 -pygments==2.6.1 -pylama==7.7.1 -pylint==2.5.3 -pyparsing==2.4.7 -pytest-django==3.9.0 -pytest==6.0.1 -python-dateutil==2.8.1 -python-ldap==3.3.1 -pytz==2020.1 -requests==2.24.0 -six==1.15.0 +pyflakes==2.2.0 # via -r ./test.txt, flake8, pylama +pygments==2.6.1 # via -r ./test.txt, ipython +pylama==7.7.1 # via -r dev.in +pylint==2.5.3 # via -r dev.in +pyparsing==2.4.7 # via -r ./test.txt, packaging +pytest-django==3.9.0 # via -r ./test.txt +pytest==6.0.1 # via -r ./test.txt, pytest-django +python-dateutil==2.8.1 # via -r ./test.txt, arrow, faker, ics +python-ldap==3.3.1 # via -r ./test.txt, django-auth-ldap +pytz==2020.1 # via -r ./test.txt, django, django-modelcluster, l18n +requests==2.24.0 # via -r ./test.txt, wagtail +six==1.15.0 # via -r ./test.txt, astroid, django-coverage-plugin, django-modeltranslation, html5lib, ics, l18n, packaging, pip-tools, python-dateutil, traitlets snowballstemmer==2.0.0 # via pydocstyle -soupsieve==2.0.1 -sqlparse==0.3.1 -tablib[xls,xlsx]==2.0.0 -tatsu==4.4.0 +soupsieve==2.0.1 # via -r ./test.txt, beautifulsoup4 +sqlparse==0.3.1 # via -r ./test.txt, django, django-debug-toolbar +tablib[xls,xlsx]==2.0.0 # via -r ./test.txt, wagtail +tatsu==4.4.0 # via -r ./test.txt, ics text-unidecode==1.3 # via faker -toml==0.10.1 +toml==0.10.1 # via -r ./test.txt, pylint, pytest traitlets==4.3.3 # via ipython typed-ast==1.4.1 # via astroid -unidecode==1.1.1 -urllib3==1.25.10 -wagtail-modeltranslation==0.10.13 -wagtail==2.10 +unidecode==1.1.1 # via -r ./test.txt, wagtail +urllib3==1.25.10 # via -r ./test.txt, requests +git+https://github.com/buczek/wagtail-modeltranslation.git@add-toggle-configure # via -r ./test.txt +wagtail==2.10 # via -r ./test.txt, wagtail-modeltranslation wcwidth==0.2.5 # via prompt-toolkit -webencodings==0.5.1 -willow==1.4 +webencodings==0.5.1 # via -r ./test.txt, html5lib +willow==1.4 # via -r ./test.txt, wagtail wrapt==1.12.1 # via astroid -xlrd==1.2.0 -xlsxwriter==1.3.2 -xlwt==1.3.0 -zipp==3.1.0 +xlrd==1.2.0 # via -r ./test.txt, tablib +xlsxwriter==1.3.2 # via -r ./test.txt, wagtail +xlwt==1.3.0 # via -r ./test.txt, tablib +zipp==3.1.0 # via -r ./test.txt, importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/production.txt b/requirements/production.txt index 0652fde..ace3e17 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -4,50 +4,50 @@ # # pip-compile --output-file=production.txt production.in # -arrow==0.14.7 -asgiref==3.2.10 -beautifulsoup4==4.8.2 -certifi==2020.6.20 -chardet==3.0.4 -django-auth-ldap==2.2.0 -django-filter==2.3.0 -django-modelcluster==5.0.2 -django-modeltranslation==0.15.1 -django-taggit==1.3.0 -django-treebeard==4.3.1 -django==3.1 -djangorestframework==3.11.1 -draftjs-exporter==2.1.7 -et-xmlfile==1.0.1 -html5lib==1.1 -ics==0.7 -idna==2.10 -importlib-metadata==1.7.0 -jdcal==1.4.1 -l18n==2018.5 -markdown==3.2.2 -openpyxl==3.0.4 -pillow==7.2.0 -psycopg2-binary==2.8.5 -pyasn1-modules==0.2.8 -pyasn1==0.4.8 -pygments==2.6.1 -python-dateutil==2.8.1 -python-ldap==3.3.1 -pytz==2020.1 -requests==2.24.0 -six==1.15.0 -soupsieve==2.0.1 -sqlparse==0.3.1 -tablib[xls,xlsx]==2.0.0 -tatsu==4.4.0 -unidecode==1.1.1 -urllib3==1.25.10 -wagtail-modeltranslation==0.10.13 -wagtail==2.10 -webencodings==0.5.1 -willow==1.4 -xlrd==1.2.0 -xlsxwriter==1.3.2 -xlwt==1.3.0 -zipp==3.1.0 +arrow==0.14.7 # via -r ./base.txt, ics +asgiref==3.2.10 # via -r ./base.txt, django +beautifulsoup4==4.8.2 # via -r ./base.txt, wagtail +certifi==2020.6.20 # via -r ./base.txt, requests +chardet==3.0.4 # via -r ./base.txt, requests +django-auth-ldap==2.2.0 # via -r ./base.txt +django-filter==2.3.0 # via -r ./base.txt, wagtail +django-modelcluster==5.0.2 # via -r ./base.txt, wagtail +django-modeltranslation==0.15.1 # via -r ./base.txt, wagtail-modeltranslation +django-taggit==1.3.0 # via -r ./base.txt, wagtail +django-treebeard==4.3.1 # via -r ./base.txt, wagtail +django==3.1 # via -r ./base.txt, django-auth-ldap, django-filter, django-modeltranslation, django-taggit, django-treebeard, djangorestframework, wagtail +djangorestframework==3.11.1 # via -r ./base.txt, wagtail +draftjs-exporter==2.1.7 # via -r ./base.txt, wagtail +et-xmlfile==1.0.1 # via -r ./base.txt, openpyxl +html5lib==1.1 # via -r ./base.txt, wagtail +ics==0.7 # via -r ./base.txt +idna==2.10 # via -r ./base.txt, requests +importlib-metadata==1.7.0 # via -r ./base.txt, markdown +jdcal==1.4.1 # via -r ./base.txt, openpyxl +l18n==2018.5 # via -r ./base.txt, wagtail +markdown==3.2.2 # via -r ./base.txt +openpyxl==3.0.4 # via -r ./base.txt, tablib +pillow==7.2.0 # via -r ./base.txt, wagtail +psycopg2-binary==2.8.5 # via -r ./base.txt +pyasn1-modules==0.2.8 # via -r ./base.txt, python-ldap +pyasn1==0.4.8 # via -r ./base.txt, pyasn1-modules, python-ldap +pygments==2.6.1 # via -r ./base.txt +python-dateutil==2.8.1 # via -r ./base.txt, arrow, ics +python-ldap==3.3.1 # via -r ./base.txt, django-auth-ldap +pytz==2020.1 # via -r ./base.txt, django, django-modelcluster, l18n +requests==2.24.0 # via -r ./base.txt, wagtail +six==1.15.0 # via -r ./base.txt, django-modeltranslation, html5lib, ics, l18n, python-dateutil +soupsieve==2.0.1 # via -r ./base.txt, beautifulsoup4 +sqlparse==0.3.1 # via -r ./base.txt, django +tablib[xls,xlsx]==2.0.0 # via -r ./base.txt, wagtail +tatsu==4.4.0 # via -r ./base.txt, ics +unidecode==1.1.1 # via -r ./base.txt, wagtail +urllib3==1.25.10 # via -r ./base.txt, requests +git+https://github.com/buczek/wagtail-modeltranslation.git@add-toggle-configure # via -r ./base.txt +wagtail==2.10 # via -r ./base.txt, wagtail-modeltranslation +webencodings==0.5.1 # via -r ./base.txt, html5lib +willow==1.4 # via -r ./base.txt, wagtail +xlrd==1.2.0 # via -r ./base.txt, tablib +xlsxwriter==1.3.2 # via -r ./base.txt, wagtail +xlwt==1.3.0 # via -r ./base.txt, tablib +zipp==3.1.0 # via -r ./base.txt, importlib-metadata diff --git a/requirements/test.txt b/requirements/test.txt index 06ef5c9..6d6eb6d 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,66 +4,66 @@ # # pip-compile --output-file=test.txt test.in # -arrow==0.14.7 -asgiref==3.2.10 +arrow==0.14.7 # via -r ./base.txt, ics +asgiref==3.2.10 # via -r ./base.txt, django attrs==19.3.0 # via pytest -beautifulsoup4==4.8.2 -certifi==2020.6.20 -chardet==3.0.4 -coverage==5.2.1 -django-auth-ldap==2.2.0 -django-coverage-plugin==1.8.0 -django-filter==2.3.0 -django-modelcluster==5.0.2 -django-modeltranslation==0.15.1 -django-taggit==1.3.0 -django-treebeard==4.3.1 -django==3.1 -djangorestframework==3.11.1 -draftjs-exporter==2.1.7 -et-xmlfile==1.0.1 -flake8==3.8.3 -html5lib==1.1 -ics==0.7 -idna==2.10 -importlib-metadata==1.7.0 +beautifulsoup4==4.8.2 # via -r ./base.txt, wagtail +certifi==2020.6.20 # via -r ./base.txt, requests +chardet==3.0.4 # via -r ./base.txt, requests +coverage==5.2.1 # via -r test.in, django-coverage-plugin +django-auth-ldap==2.2.0 # via -r ./base.txt +django-coverage-plugin==1.8.0 # via -r test.in +django-filter==2.3.0 # via -r ./base.txt, wagtail +django-modelcluster==5.0.2 # via -r ./base.txt, wagtail +django-modeltranslation==0.15.1 # via -r ./base.txt, wagtail-modeltranslation +django-taggit==1.3.0 # via -r ./base.txt, wagtail +django-treebeard==4.3.1 # via -r ./base.txt, wagtail +django==3.1 # via -r ./base.txt, django-auth-ldap, django-filter, django-modeltranslation, django-taggit, django-treebeard, djangorestframework, wagtail +djangorestframework==3.11.1 # via -r ./base.txt, wagtail +draftjs-exporter==2.1.7 # via -r ./base.txt, wagtail +et-xmlfile==1.0.1 # via -r ./base.txt, openpyxl +flake8==3.8.3 # via -r test.in +html5lib==1.1 # via -r ./base.txt, wagtail +ics==0.7 # via -r ./base.txt +idna==2.10 # via -r ./base.txt, requests +importlib-metadata==1.7.0 # via -r ./base.txt, flake8, markdown, pluggy, pytest iniconfig==1.0.1 # via pytest -jdcal==1.4.1 -l18n==2018.5 -markdown==3.2.2 +jdcal==1.4.1 # via -r ./base.txt, openpyxl +l18n==2018.5 # via -r ./base.txt, wagtail +markdown==3.2.2 # via -r ./base.txt mccabe==0.6.1 # via flake8 more-itertools==8.4.0 # via pytest -openpyxl==3.0.4 +openpyxl==3.0.4 # via -r ./base.txt, tablib packaging==20.4 # via pytest -pillow==7.2.0 +pillow==7.2.0 # via -r ./base.txt, wagtail pluggy==0.13.1 # via pytest -psycopg2-binary==2.8.5 +psycopg2-binary==2.8.5 # via -r ./base.txt py==1.9.0 # via pytest -pyasn1-modules==0.2.8 -pyasn1==0.4.8 +pyasn1-modules==0.2.8 # via -r ./base.txt, python-ldap +pyasn1==0.4.8 # via -r ./base.txt, pyasn1-modules, python-ldap pycodestyle==2.6.0 # via flake8 pyflakes==2.2.0 # via flake8 -pygments==2.6.1 +pygments==2.6.1 # via -r ./base.txt pyparsing==2.4.7 # via packaging -pytest-django==3.9.0 -pytest==6.0.1 -python-dateutil==2.8.1 -python-ldap==3.3.1 -pytz==2020.1 -requests==2.24.0 -six==1.15.0 -soupsieve==2.0.1 -sqlparse==0.3.1 -tablib[xls,xlsx]==2.0.0 -tatsu==4.4.0 +pytest-django==3.9.0 # via -r test.in +pytest==6.0.1 # via -r test.in, pytest-django +python-dateutil==2.8.1 # via -r ./base.txt, arrow, ics +python-ldap==3.3.1 # via -r ./base.txt, django-auth-ldap +pytz==2020.1 # via -r ./base.txt, django, django-modelcluster, l18n +requests==2.24.0 # via -r ./base.txt, wagtail +six==1.15.0 # via -r ./base.txt, django-coverage-plugin, django-modeltranslation, html5lib, ics, l18n, packaging, python-dateutil +soupsieve==2.0.1 # via -r ./base.txt, beautifulsoup4 +sqlparse==0.3.1 # via -r ./base.txt, django +tablib[xls,xlsx]==2.0.0 # via -r ./base.txt, wagtail +tatsu==4.4.0 # via -r ./base.txt, ics toml==0.10.1 # via pytest -unidecode==1.1.1 -urllib3==1.25.10 -wagtail-modeltranslation==0.10.13 -wagtail==2.10 -webencodings==0.5.1 -willow==1.4 -xlrd==1.2.0 -xlsxwriter==1.3.2 -xlwt==1.3.0 -zipp==3.1.0 +unidecode==1.1.1 # via -r ./base.txt, wagtail +urllib3==1.25.10 # via -r ./base.txt, requests +git+https://github.com/buczek/wagtail-modeltranslation.git@add-toggle-configure # via -r ./base.txt +wagtail==2.10 # via -r ./base.txt, wagtail-modeltranslation +webencodings==0.5.1 # via -r ./base.txt, html5lib +willow==1.4 # via -r ./base.txt, wagtail +xlrd==1.2.0 # via -r ./base.txt, tablib +xlsxwriter==1.3.2 # via -r ./base.txt, wagtail +xlwt==1.3.0 # via -r ./base.txt, tablib +zipp==3.1.0 # via -r ./base.txt, importlib-metadata From b7dcdc32618587b95a50c36551f115c6d21519c8 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 16 Sep 2020 12:38:42 +0200 Subject: [PATCH 8/8] Set WAGTAILMODELTRANSLATION_LOCALE_PICKER_DEFAULT --- config/settings/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/settings/base.py b/config/settings/base.py index 625ea01..bc6f4b4 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -226,6 +226,7 @@ ] WAGTAILMODELTRANSLATION_TRANSLATE_SLUGS = False +WAGTAILMODELTRANSLATION_LOCALE_PICKER_DEFAULT = ('de', 'en') # WAGTAIL WAGTAIL_SITE_NAME = 'MPI CMS'