Fix bad stoken error.

We were calling the validation constructor wrong.
This commit is contained in:
Tom Hacohen 2020-10-08 21:01:45 +03:00
parent 06f2dd72a7
commit 9152e6f42d

View File

@ -116,11 +116,7 @@ class BaseViewSet(viewsets.ModelViewSet):
try: try:
return Stoken.objects.get(uid=stoken) return Stoken.objects.get(uid=stoken)
except Stoken.DoesNotExist: except Stoken.DoesNotExist:
raise EtebaseValidationError({ raise EtebaseValidationError('bad_stoken', 'Invalid stoken.', status_code=status.HTTP_400_BAD_REQUEST)
'code': 'bad_stoken',
'detail': 'Invalid stoken.',
},
status_code=status.HTTP_400_BAD_REQUEST)
return None return None