FIX(promotions): default event status promotion_amount to 0

get_event_status_for_user returned None whenever the event was
already processed, no plan matched, or the user lacked access to the
recipient. Callers now always get a concrete amount: the real payout
if accessible, 0 otherwise.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Ali Asadi 2026-08-03 17:33:59 +03:30
parent 0e95fab85f
commit ac37f15bea

View file

@ -393,7 +393,7 @@ class PromotionQuerySet(models.QuerySet):
def get_event_status_for_user(user_uuid, event_label):
processed = Promotion.objects.is_processed_for_user(user_uuid, event_label)
promotion_amount = None
promotion_amount = 0
if not processed:
plan = Plan.objects.filter(event_list__icontains=event_label).first()
if plan: