diff --git a/abonapp/locale/ru/LC_MESSAGES/django.po b/abonapp/locale/ru/LC_MESSAGES/django.po index 5bb4ba3..36f757f 100644 --- a/abonapp/locale/ru/LC_MESSAGES/django.po +++ b/abonapp/locale/ru/LC_MESSAGES/django.po @@ -206,12 +206,6 @@ msgstr "Абонент" msgid "Abons" msgstr "Абоненты" -#: models.py:230 -msgid "User that is no staff can not buy admin services" -msgstr "" -"Пользователь, который не является персоналом не может покупать услуги для " -"внутренних нужд" - #: models.py:235 msgid "That service already activated" msgstr "Эта услуга уже подключена" diff --git a/abonapp/models.py b/abonapp/models.py index 56cfebc..977beb2 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -203,11 +203,9 @@ class Abon(BaseAccount): amount = round(tariff.amount, 2) - if tariff.is_admin: - if author is not None and not author.is_staff: + if tariff.is_admin and author is not None: + if not author.is_staff: raise LogicError(_('User that is no staff can not buy admin services')) - else: - raise LogicError(_('This user can not buy admin services')) if self.current_tariff is not None: if self.current_tariff.tariff == tariff: diff --git a/abonapp/views.py b/abonapp/views.py index 9b7a710..ebc4785 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -61,10 +61,9 @@ class PeoplesListView(BaseAbonListView): except mydefs.LogicError as e: messages.warning(self.request, e) ordering = self.get_ordering() - if ordering: - if isinstance(ordering, str): - ordering = (ordering,) - peoples_list = peoples_list.order_by(*ordering) + if ordering and isinstance(ordering, str): + ordering = (ordering,) + peoples_list = peoples_list.order_by(*ordering) return peoples_list def get_context_data(self, **kwargs):