Skip to content

Commit

Permalink
Drop pre-Wagtail 5.2 logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab committed Feb 10, 2024
1 parent 6836f63 commit 0f71642
Showing 10 changed files with 154 additions and 472 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ jobs:

- run: pip install flit
- run: flit install --deps production --extras testing
- run: pip install "wagtail_modeladmin<2.0"

- type: cache-save
key: pip-{{ .Branch }}-{{ epoch }}

This file was deleted.

4 changes: 0 additions & 4 deletions wagtail_localize/locales/templates/wagtaillocales/index.html
Original file line number Diff line number Diff line change
@@ -29,11 +29,7 @@
<a href="{% url 'wagtaillocales:edit' locale.id %}">{{ locale }}</a>
{% if not locale.language_code_is_valid %}
{% trans "This locale's language code is not supported" as error %}
{% if wagtail_version >= "5.1" %}
{% include "wagtaillocales/_icon.html" with error=error only %}
{% else %}
{% include "wagtaillocales/_icon_legacy.html" with error=error only %}
{% endif %}
{% endif %}
</div>
</td>
31 changes: 9 additions & 22 deletions wagtail_localize/modeladmin/views.py
Original file line number Diff line number Diff line change
@@ -11,34 +11,21 @@
from django.utils.translation import gettext as _
from wagtail.models import Locale, TranslatableMixin
from wagtail.utils.version import get_main_version
from wagtail_modeladmin.views import (
ChooseParentView,
CreateView,
DeleteView,
EditView,
HistoryView,
IndexView,
InspectView,
)

from wagtail_localize.models import Translation
from wagtail_localize.views import edit_translation
from wagtail_localize.views.submit_translations import SubmitTranslationView


try:
from wagtail_modeladmin.views import (
ChooseParentView,
CreateView,
DeleteView,
EditView,
HistoryView,
IndexView,
InspectView,
)
except ImportError:
from wagtail.contrib.modeladmin.views import (
ChooseParentView,
CreateView,
DeleteView,
EditView,
HistoryView,
IndexView,
InspectView,
)


class TranslatableViewMixin:
def __init__(self, *args, **kwargs):
self.locale = None

This file was deleted.

Loading

0 comments on commit 0f71642

Please sign in to comment.