diff --git a/suit/admin_filters.py b/suit/admin_filters.py index e67cf83d..eb8adbd5 100644 --- a/suit/admin_filters.py +++ b/suit/admin_filters.py @@ -1,4 +1,10 @@ -from django.utils.translation import ugettext_lazy as _ +from django import VERSION as django_version + +if django_version >= (3, 0): + from django.utils.translation import gettext_lazy as _ +else: + from django.utils.translation import ugettext_lazy as _ + from django.contrib.admin import FieldListFilter diff --git a/suit/menu.py b/suit/menu.py index 51167dff..eb4e9dab 100644 --- a/suit/menu.py +++ b/suit/menu.py @@ -1,5 +1,10 @@ from copy import deepcopy -from django.utils.translation import ugettext_lazy as _ +from django import VERSION as django_version + +if django_version >= (3, 0): + from django.utils.translation import gettext_lazy as _ +else: + from django.utils.translation import ugettext_lazy as _ class ChildItem(object): @@ -170,7 +175,7 @@ def make_child_from_native_model(self, native_model): """ :type native_model: dict """ - child_item = ChildItem(native_model['name'], model=native_model.get('model'), url=native_model['admin_url']) + child_item = ChildItem(native_model['name'], model=native_model.get('model'), url=native_model['admin_url']) return child_item def handle_parent_menu(self, parent_item, native_app):