diff --git a/apps/third/views_d.py b/apps/third/views_d.py index fb622632..d7f49192 100644 --- a/apps/third/views_d.py +++ b/apps/third/views_d.py @@ -57,7 +57,8 @@ class BltViewSet(CustomGenericViewSet): blt_list = res['recordList'] macs = [] for i in blt_list: - macs.append(i['mac']) + if 'online' in i and i['online']: + macs.append(i['mac']) qs = self.queryset.filter(code__in=macs).exclude(employee=None) ret['total'] = qs.count() ret['count_employee'] = qs.filter(employee__type='employee').count() @@ -97,7 +98,7 @@ class BltViewSet(CustomGenericViewSet): blt_list = res['recordList'] macs = [] for i in blt_list: - if 'online' in i and i['online'] == False: + if 'online' in i and i['online'] is False: pass else: if 'userId' in i: