From 9152e6f42d4afe8166b864170ea708f071441639 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 8 Oct 2020 21:01:45 +0300 Subject: [PATCH] Fix bad stoken error. We were calling the validation constructor wrong. --- django_etebase/views.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/django_etebase/views.py b/django_etebase/views.py index 31e914a..6003d4b 100644 --- a/django_etebase/views.py +++ b/django_etebase/views.py @@ -116,11 +116,7 @@ class BaseViewSet(viewsets.ModelViewSet): try: return Stoken.objects.get(uid=stoken) except Stoken.DoesNotExist: - raise EtebaseValidationError({ - 'code': 'bad_stoken', - 'detail': 'Invalid stoken.', - }, - status_code=status.HTTP_400_BAD_REQUEST) + raise EtebaseValidationError('bad_stoken', 'Invalid stoken.', status_code=status.HTTP_400_BAD_REQUEST) return None