фв
This commit is contained in:
1 parent
a796bb7483
commit
75cac4b928
2 files changed
+3
-1
No files matched your search
@@ -60,12 +60,14 @@ class VoteDetail(generics.RetrieveUpdateDestroyAPIView):
|
|||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
results = Result.objects.filter(answer__question__vote=kwargs['id'])
|
results = Result.objects.filter(answer__question__vote=kwargs['id'])
|
||||||
|
|
||||||
if results:
|
if results:
|
||||||
return Response({'status': 'error', 'message': 'voted'}, status=400)
|
return Response({'status': 'error', 'message': 'voted'}, status=400)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vote = Vote.objects.get(id=kwargs['id'])
|
vote = Vote.objects.get(id=kwargs['id'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
||||||
return Response({'status': 'error', 'message': str(e)}, status=400)
|
return Response({'status': 'error', 'message': str(e)}, status=400)
|
||||||
|
|
||||||
answers_employee = Answer.objects.filter(question__vote=vote).filter(question__settings__choice="employee").values('name', 'question')
|
answers_employee = Answer.objects.filter(question__vote=vote).filter(question__settings__choice="employee").values('name', 'question')
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
type="error"
|
type="error"
|
||||||
density="compact"
|
density="compact"
|
||||||
title="Ошибка авторизации"
|
title="Ошибка авторизации"
|
||||||
:text="info"
|
|
||||||
v-model="alert"
|
v-model="alert"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user