Merge branch 'member-summary'

This commit is contained in:
Tanner Collin 2020-11-15 01:54:00 +00:00
commit 19fa620296
3 changed files with 12 additions and 2 deletions

View File

@ -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)))

View File

@ -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

View File

@ -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'
}, },