|
|
|
@ -11,7 +11,7 @@ from django.http import HttpResponse |
|
|
|
from django.contrib import messages |
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
|
|
from statistics.models import getModel |
|
|
|
from statistics.models import StatCache |
|
|
|
from tariff_app.models import Tariff |
|
|
|
from agent import NasFailedResult, Transmitter, NasNetworkError |
|
|
|
from . import forms |
|
|
|
@ -33,8 +33,6 @@ def peoples(request, gid): |
|
|
|
else: |
|
|
|
peoples_list = peoples_list.filter(group=gid) |
|
|
|
|
|
|
|
StatModel = getModel() |
|
|
|
|
|
|
|
# фильтр |
|
|
|
dr, field = mydefs.order_helper(request) |
|
|
|
if field: |
|
|
|
@ -44,10 +42,10 @@ def peoples(request, gid): |
|
|
|
peoples_list = mydefs.pag_mn(request, peoples_list) |
|
|
|
for abon in peoples_list: |
|
|
|
if abon.ip_address is not None: |
|
|
|
traf = StatModel.objects.traffic_by_ip(abon.ip_address) |
|
|
|
if traf[1] is not None: |
|
|
|
abon.traf = traf[1] |
|
|
|
abon.is_online =traf[0] |
|
|
|
try: |
|
|
|
abon.stat_cache = StatCache.objects.get(ip=abon.ip_address) |
|
|
|
except StatCache.DoesNotExist: |
|
|
|
pass |
|
|
|
|
|
|
|
except mydefs.LogicError as e: |
|
|
|
messages.warning(request, e) |
|
|
|
|