Update views.py

This commit is contained in:
Nukeap committed 2025-01-20 10:37:07 +03:00
1 parent ea19aca7ad
commit 7b130a4350
1 file changed
+2 -2
+2 -2
View File
@@ -86,8 +86,8 @@ class VoteDetail(generics.RetrieveUpdateDestroyAPIView):
class VoteCreate(APIView):
def post(self, request):
vote = self.create_vote(request)
try:
vote = self.create_vote(request)
self.create_news(request, vote)
return Response({'status': 'success', 'message': 'Vote and news created successfully.'}, status=200)
except Exception as e:
@@ -97,7 +97,7 @@ class VoteCreate(APIView):
def create_vote(self, request):
user = request.user
print(request.data)
# for test
# # user = DictEmployee.objects.get(login='9966-00-125')
# # user = User.objects.get(user=user)