Compare commits
No commits in common. "6060_disallowed_hosts_fix" and "master" have entirely different histories.
6060_disal
...
master
2 changed files with 1 additions and 26 deletions
|
@ -11,7 +11,6 @@ import os
|
|||
# dotenv
|
||||
import dotenv
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from utils.log_filters import skip_suspicious_operations
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -692,31 +691,11 @@ if ENABLE_LOGGING:
|
|||
}
|
||||
}
|
||||
handlers_dict.update(custom_handler_item)
|
||||
|
||||
# Skip emails for Disallowed Hosts errors
|
||||
# https://redmine.ungleich.ch/issues/6060
|
||||
|
||||
skip_suspicious_operations_handler = {
|
||||
'mail_admins': {
|
||||
'level': 'ERROR',
|
||||
'filters': ['skip_suspicious_operations'],
|
||||
'include_html' : True,
|
||||
}
|
||||
}
|
||||
|
||||
handlers_dict.update(skip_suspicious_operations_handler)
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'handlers': handlers_dict,
|
||||
'loggers': loggers_dict,
|
||||
'filters': {
|
||||
'skip_suspicious_operations': {
|
||||
'()': 'django.utils.log.CallbackFilter',
|
||||
'callback': skip_suspicious_operations,
|
||||
}
|
||||
}
|
||||
'loggers': loggers_dict
|
||||
}
|
||||
|
||||
TEST_MANAGE_SSH_KEY_PUBKEY = env('TEST_MANAGE_SSH_KEY_PUBKEY')
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
def skip_suspicious_operations(record):
|
||||
if record.name == 'django.security.DisallowedHost':
|
||||
return False
|
||||
return True
|
Loading…
Reference in a new issue