Merge branch 'member-summary'
This commit is contained in:
commit
19fa620296
|
@ -14,7 +14,7 @@ def ldap_api(route, data):
|
||||||
try:
|
try:
|
||||||
headers = {'Authorization': 'Token ' + secrets.LDAP_API_KEY}
|
headers = {'Authorization': 'Token ' + secrets.LDAP_API_KEY}
|
||||||
url = secrets.LDAP_API_URL + route
|
url = secrets.LDAP_API_URL + route
|
||||||
r = requests.post(url, data=data, headers=headers, timeout=3)
|
r = requests.post(url, data=data, headers=headers, timeout=5)
|
||||||
return r.status_code
|
return r.status_code
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
logger.error('LDAP {} - {} - {}'.format(url, e.__class__.__name__, str(e)))
|
logger.error('LDAP {} - {} - {}'.format(url, e.__class__.__name__, str(e)))
|
||||||
|
|
|
@ -8,3 +8,10 @@ class IgnoreStats(logging.Filter):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
class IgnoreLockout(logging.Filter):
|
||||||
|
def filter(self, record):
|
||||||
|
if 'GET /lockout/' in record.msg:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
|
@ -221,11 +221,14 @@ LOGGING = {
|
||||||
'ignore_stats': {
|
'ignore_stats': {
|
||||||
'()': 'apiserver.filters.IgnoreStats',
|
'()': 'apiserver.filters.IgnoreStats',
|
||||||
},
|
},
|
||||||
|
'ignore_lockout': {
|
||||||
|
'()': 'apiserver.filters.IgnoreLockout',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'console': {
|
'console': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'filters': ['ignore_stats'],
|
'filters': ['ignore_stats', 'ignore_lockout'],
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
'formatter': 'medium'
|
'formatter': 'medium'
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user