Skip to content

Commit

Permalink
Remove deprecation path for older versions of django
Browse files Browse the repository at this point in the history
  • Loading branch information
ticosax committed Mar 24, 2023
1 parent fcf3ce7 commit eea70a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
9 changes: 2 additions & 7 deletions django_fsm_log/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,8 @@ def post_transition_callback(sender, instance, name, source, target, **kwargs):


if settings.DJANGO_FSM_LOG_STORAGE_METHOD == "django_fsm_log.backends.CachedBackend":
try:
from django.core.cache import caches
except ImportError:
from django.core.cache import get_cache # Deprecated, removed in 1.9.
from django.core.cache import caches

cache = get_cache(settings.DJANGO_FSM_LOG_CACHE_BACKEND)
else:
cache = caches[settings.DJANGO_FSM_LOG_CACHE_BACKEND]
cache = caches[settings.DJANGO_FSM_LOG_CACHE_BACKEND]
else:
cache = None
6 changes: 1 addition & 5 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
try:
from django.urls import reverse
except ImportError:
# django<=1.10
from django.core.urlresolvers import reverse
from django.urls import reverse


def test_state_log_inline_django2(article, admin_client, admin_user):
Expand Down
13 changes: 3 additions & 10 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
try:
from django.contrib import admin
from django.urls import path
from django.contrib import admin
from django.urls import path

urlpatterns = [path("admin", admin.site.urls)]
except ImportError:
# django < 2.0
from django.contrib import admin
from django.urls import include, path

urlpatterns = [path("admin/", include(admin.site.urls))]
urlpatterns = [path("admin", admin.site.urls)]

0 comments on commit eea70a9

Please sign in to comment.