mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
Merge pull request #332 from KiwiTechLLC/ZBKBCK-52
fixed article reward points notification for 0 points earned
This commit is contained in:
@ -711,6 +711,7 @@ class CompleteArticleAPIView(views.APIView):
|
|||||||
is_answer_correct=True).aggregate(
|
is_answer_correct=True).aggregate(
|
||||||
total_earn_points=Sum('earn_points'))['total_earn_points']
|
total_earn_points=Sum('earn_points'))['total_earn_points']
|
||||||
data = {"total_earn_points":total_earn_points}
|
data = {"total_earn_points":total_earn_points}
|
||||||
|
if total_earn_points:
|
||||||
send_notification.delay(ARTICLE_REWARD_POINTS, None, None,
|
send_notification.delay(ARTICLE_REWARD_POINTS, None, None,
|
||||||
request.user.id, {'points': total_earn_points})
|
request.user.id, {'points': total_earn_points})
|
||||||
return custom_response(SUCCESS_CODE['3042'], data, response_status=status.HTTP_200_OK)
|
return custom_response(SUCCESS_CODE['3042'], data, response_status=status.HTTP_200_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user