From 47c7d4579336833213203f3e127d4155ed25b555 Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 29 Apr 2026 07:14:14 +0300 Subject: [PATCH] fix: traffic addon discount also bypassed tariff-promo-group check --- app/services/pricing_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/pricing_engine.py b/app/services/pricing_engine.py index a546484f..4d6d3c8f 100644 --- a/app/services/pricing_engine.py +++ b/app/services/pricing_engine.py @@ -615,9 +615,9 @@ class PricingEngine: discounted_base = self.apply_discount(base_price, period_pct) discounted_devices = self.apply_discount(devices_price, devices_pct) - # Traffic uses addon discount (checks apply_discounts_to_addons flag) + # Traffic uses addon discount — but only if promo_group passed the tariff availability check discounted_traffic = traffic_price - if traffic_price > 0 and user: + if traffic_price > 0 and user and promo_group is not None: discounted_traffic, _, _ = self.calculate_traffic_discount(traffic_price, user) base_group_disc = base_price - discounted_base