调整log>400

This commit is contained in:
曹前明 2022-06-23 23:59:02 +08:00
parent 91ec77ba5f
commit 12d631f5b7
4 changed files with 12 additions and 6 deletions

View File

@ -133,3 +133,9 @@ class HrmService:
_, res = dhClient.request(**dhapis['card_add'], json=json_data)
dh_face_card = res['id']
return {'dh_id': dh_id, 'dh_photo': dh_photo, 'dh_face_card': dh_face_card}
def swipe(cls, data:dict):
"""
刷卡事件
"""
pass

View File

@ -170,9 +170,9 @@ class DhCommonViewSet(CreateModelMixin, CustomGenericViewSet):
"monitor": settings.BASE_URL + '/api/third/dahua/mq/',
"monitorType": "url",
"events": [
{
"category": "business",
},
# {
# "category": "business",
# },
{
"category": "alarm",
},

View File

@ -72,8 +72,8 @@ class DhClient:
if raise_exception:
raise APIException(**DH_REQUEST_ERROR)
return 'error', DH_REQUEST_ERROR
if settings.DEBUG:
print_roundtrip(r)
# if settings.DEBUG:
# print_roundtrip(r)
if r.status_code == 200:
ret = r.json()
if ret.get('code') == '27001007':

View File

@ -240,7 +240,7 @@ class MyLoggingMixin(object):
"""
return (
self.logging_methods == "__all__" or request.method in self.logging_methods
) and (response.status_code not in (401, 403))
) and (response.status_code > 404)
def _clean_data(self, data):
"""