P-142
This commit is contained in:
1 parent
9427077d37
commit
8510a2a725
3 files changed
+7
-5
No files matched your search
@@ -120,7 +120,8 @@ class VoteCreate(APIView):
|
||||
def post(self, request):
|
||||
try:
|
||||
vote = self.create_vote(request)
|
||||
self.create_news(request, vote)
|
||||
if request.data.get('news') == 'true':
|
||||
self.create_news(request, vote)
|
||||
return Response({'status': 'success', 'message': 'Vote and news created successfully.'}, status=200)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -172,9 +173,10 @@ class VoteCreate(APIView):
|
||||
cdate = request.data['startDate'],
|
||||
author = request.user,
|
||||
link = os.path.join('defaultimg','vote.png'),
|
||||
vote = vote
|
||||
)
|
||||
news.save()
|
||||
news.save()
|
||||
vote.news = news
|
||||
vote.save()
|
||||
|
||||
def make_clickable(text, url):
|
||||
text = html.escape(text)
|
||||
|
||||
Reference in new issue
Block a user