Skip to content

Commit 6816c41

Browse files
author
TheLazzziest
committed
Add import of smart_text.
1 parent 7abeb81 commit 6816c41

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rest_framework_sso/models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
from django.conf import settings
88
from django.db import models
9-
from django.utils.encoding import python_2_unicode_compatible
9+
10+
try:
11+
from django.utils.encoding import python_2_unicode_compatible as smart_text
12+
except ImportError:
13+
from django.utils.encoding import smart_text
14+
1015
from django.utils.translation import ugettext_lazy as _
1116

1217
# Prior to Django 1.5, the AUTH_USER_MODEL setting does not exist.
@@ -22,7 +27,7 @@
2227
AUTH_USER_MODEL = getattr(settings, "AUTH_USER_MODEL", "auth.User")
2328

2429

25-
@python_2_unicode_compatible
30+
@smart_text
2631
class SessionToken(models.Model):
2732
"""
2833
The default session token model.

0 commit comments

Comments
 (0)