diff --git a/abonapp/locale/ru/LC_MESSAGES/django.po b/abonapp/locale/ru/LC_MESSAGES/django.po index cd4b848..a36cae2 100644 --- a/abonapp/locale/ru/LC_MESSAGES/django.po +++ b/abonapp/locale/ru/LC_MESSAGES/django.po @@ -211,8 +211,8 @@ msgid "Buy service default log" msgstr "Покупка тарифного плана через админку" #: models.py:228 -msgid "You have not any active leases" -msgstr "Учётная запись не имеет ни одной активной сессии" +msgid "Account %(username)s not have any active leases" +msgstr "Учётная зап %(username)sсь не имеет ни одной активной сессии" #: models.py:236 models.py:253 models.py:270 views.py:667 views.py:1100 #: views.py:1143 diff --git a/abonapp/models.py b/abonapp/models.py index 21461cb..7ea8dfc 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -225,7 +225,9 @@ class Abon(BaseAccount): agent_trf = TariffStruct(trf.id, trf.speedIn, trf.speedOut) if len(abon_addresses) > 0: return AbonStruct(self.pk, abon_addresses, agent_trf, self.is_access()) - raise LogicError(_('You have not any active leases')) + raise LogicError(_('Account "%(username)s" not have any active leases') % { + 'username': self.username + }) def nas_sync_self(self) -> Optional[Exception]: """ diff --git a/abonapp/views.py b/abonapp/views.py index 05e6370..51a32e8 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -754,12 +754,14 @@ class DialsListView(OrderedFilteredList): self.abon = abon if abon.telephone is not None and abon.telephone != '': tel = abon.telephone.replace('+', '') + additional_tels = tuple(t.telephone for t in models.AdditionalTelephone.objects.filter(abon=abon).iterator()) logs = AsteriskCDR.objects.filter( - Q(src__contains=tel) | Q(dst__contains=tel) + Q(src__contains=tel) | Q(dst__contains=tel) | + Q(src__in=additional_tels) | Q(dst__in=additional_tels) ) return logs else: - return AsteriskCDR.objects.empty() + return AsteriskCDR.objects.none() def get_context_data(self, **kwargs): context = super(DialsListView, self).get_context_data(**kwargs)