fix preserve device/traffic limits on coupon
This commit is contained in:
+5
-2
@@ -235,8 +235,11 @@ async def handle_key_extension(
|
||||
tariff = None
|
||||
if key.tariff_id:
|
||||
tariff = await get_tariff_by_id(session, key.tariff_id)
|
||||
total_gb = int(tariff["traffic_limit"]) if tariff and tariff.get("traffic_limit") else 0
|
||||
device_limit = int(tariff["device_limit"]) if tariff and tariff.get("device_limit") else 0
|
||||
tariff_gb = int(tariff["traffic_limit"]) if tariff and tariff.get("traffic_limit") else 0
|
||||
tariff_devices = int(tariff["device_limit"]) if tariff and tariff.get("device_limit") else 0
|
||||
|
||||
total_gb = int(key.current_traffic_limit) if getattr(key, "current_traffic_limit", None) is not None else tariff_gb
|
||||
device_limit = int(key.current_device_limit) if getattr(key, "current_device_limit", None) is not None else tariff_devices
|
||||
|
||||
key_subgroup = None
|
||||
if tariff:
|
||||
|
||||
Reference in New Issue
Block a user