Commit 672dd660 authored by ibuler's avatar ibuler

[Bugfix] 修复一些bug

parent 23815f87
......@@ -62,7 +62,7 @@ class EncryptMixin:
def get_prep_value(self, value):
if value is None:
return value
return signer.sign(value).decode('utf-8')
return signer.sign(value)
class EncryptTextField(EncryptMixin, models.TextField):
......
......@@ -23,7 +23,7 @@ urlpatterns = [
api.SessionReplayV2ViewSet.as_view({'get': 'retrieve', 'post': 'create'}),
name='session-replay'),
path('tasks/kill-session/', api.KillSessionAPI.as_view(), name='kill-session'),
path('terminal/<uuid:terminal>/access-key', api.TerminalTokenApi.as_view(),
path('terminal/<uuid:terminal>/access-key/', api.TerminalTokenApi.as_view(),
name='terminal-access-key'),
path('terminal/config', api.TerminalConfig.as_view(), name='terminal-config'),
# v2: get session's replay
......
......@@ -118,7 +118,7 @@ class User(AbstractUser):
@otp_secret_key.setter
def otp_secret_key(self, item):
self._otp_secret_key = signer.sign(item).decode('utf-8')
self._otp_secret_key = signer.sign(item)
def get_absolute_url(self):
return reverse('users:user-detail', args=(self.id,))
......
......@@ -14,8 +14,7 @@ coreapi==2.3.3
coreschema==0.0.4
cryptography==2.1.4
decorator==4.1.2
#Django==1.11
#Django==2.0.7
Django==2.0.7
django-auth-ldap==1.3.0
django-bootstrap3==9.1.0
django-celery-beat==1.1.1
......@@ -25,7 +24,6 @@ django-ranged-response==0.2.0
django-redis-cache==1.7.1
django-rest-swagger==2.1.2
django-simple-captcha==0.5.6
#djangorestframework==3.7.3
djangorestframework==3.8.2
djangorestframework-bulk==0.2.1
docutils==0.14
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment