Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
Use six.string_types instead of basestring
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Jan 7, 2016
1 parent 9e8d7be commit 88e1f3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/permission/utils/autodiscover.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8
import copy
from django.utils import six


def autodiscover(module_name=None):
Expand Down Expand Up @@ -63,7 +64,7 @@ def discover(app, module_name=None):
# apply permission logics automatically
permission_logic_set = getattr(m, variable_name)
for model, permission_logic in permission_logic_set:
if isinstance(model, basestring):
if isinstance(model, six.string_types):
# convert model string to model instance
model = get_model(*model.split('.', 1))
add_permission_logic(model, permission_logic)
Expand Down

0 comments on commit 88e1f3e

Please sign in to comment.