Browse Source

some refactoring

devel
Dmitry Novikov 7 years ago
parent
commit
02b8437eab
  1. 8
      abonapp/models.py
  2. 1
      abonapp/tasks.py

8
abonapp/models.py

@ -83,7 +83,7 @@ class AbonStreet(models.Model):
class AbonManager(MyUserManager):
def get_queryset(self):
return super(MyUserManager, self).get_queryset().filter(is_admin=False)
return super(AbonManager, self).get_queryset().filter(is_admin=False)
def filter_ip_address(self, group_ids: tuple, nas_id: int):
nas_id = int(nas_id)
@ -188,9 +188,6 @@ class Abon(BaseAccount):
"""
return tuple("m-%s" % name for name, state in self.markers if state)
def is_markers_empty(self):
return int(self.markers) == 0
def active_tariff(self):
return self.current_tariff
@ -438,9 +435,6 @@ class InvoiceForPayment(models.Model):
self.status = True
self.date_pay = timezone.now()
def get_prev_invoice(self):
return self.objects.order
class Meta:
ordering = ('date_create',)
db_table = 'abonent_inv_pay'

1
abonapp/tasks.py

@ -12,7 +12,6 @@ def customer_nas_command(customer_uid: int, command: str):
return 'Command required'
try:
cust = Abon.objects.get(pk=customer_uid)
print(cust, command)
if command == 'sync':
r = cust.nas_sync_self()
if isinstance(r, Exception):

Loading…
Cancel
Save