Skip to content

Commit 38283ae

Browse files
committed
Use string_types from six - py2/3 compat
1 parent fc91a2f commit 38283ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

admin_reorder/middleware.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from django.conf import settings
88
from django.contrib import admin
99
from django.core.exceptions import ImproperlyConfigured
10+
from django.utils.six import string_types
1011

1112
try:
1213
from django.urls import resolve, Resolver404
@@ -63,11 +64,11 @@ def get_app_list(self):
6364
return ordered_app_list
6465

6566
def make_app(self, app_config):
66-
if not isinstance(app_config, (dict, basestring)):
67+
if not isinstance(app_config, (dict, string_types)):
6768
raise TypeError('ADMIN_REORDER list item must be '
6869
'dict or string. Got %s' % repr(app_config))
6970

70-
if isinstance(app_config, basestring):
71+
if isinstance(app_config, string_types):
7172
# Keep original label and models
7273
return self.find_app(app_config)
7374
else:

0 commit comments

Comments
 (0)