Browse Source

fixed service buy

devel
www-data 8 years ago
parent
commit
1333492185
  1. 6
      abonapp/locale/ru/LC_MESSAGES/django.po
  2. 6
      abonapp/models.py
  3. 7
      abonapp/views.py

6
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 "Эта услуга уже подключена"

6
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:

7
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):

Loading…
Cancel
Save