From c4bf0f37805d7b3f139225328f59529307c18edd Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 21 Apr 2018 11:11:56 +0300 Subject: [PATCH] Fix when tariff is none --- abonapp/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/abonapp/models.py b/abonapp/models.py index f2840b1..6a5db6b 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -263,6 +263,8 @@ class Abon(BaseAccount): else: return abon_tariff = self.active_tariff() + if abon_tariff is None: + return trf = abon_tariff.tariff agent_trf = TariffStruct(trf.id, trf.speedIn, trf.speedOut) return AbonStruct(self.pk, user_ip, agent_trf, bool(self.is_active))