From dce89e1b11f1be393f03a8cd1dee77f9441688bd Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 26 Jul 2021 14:00:47 +0200 Subject: [PATCH] multitenant: support custom admin email handler (#55824) --- hobo/multitenant/log.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hobo/multitenant/log.py b/hobo/multitenant/log.py index db23976..24013cb 100644 --- a/hobo/multitenant/log.py +++ b/hobo/multitenant/log.py @@ -14,11 +14,16 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import django.utils.log +from django.conf import settings from django.db import connection +from django.utils.module_loading import import_string +BaseAdminEmailHandler = import_string( + getattr(settings, 'ADMIN_EMAIL_HANDLER_CLASS', 'django.utils.log.AdminEmailHandler') +) -class AdminEmailHandler(django.utils.log.AdminEmailHandler): + +class AdminEmailHandler(BaseAdminEmailHandler): def format_subject(self, subject): from .models import Tenant -- 2.20.1