misc: do not send error emails when in maintenance mode (#71527) #54
|
@ -15,10 +15,17 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import django.utils.log
|
||||
from django.conf import settings
|
||||
from django.db import connection
|
||||
|
||||
|
||||
class AdminEmailHandler(django.utils.log.AdminEmailHandler):
|
||||
def emit(self, record):
|
||||
maintenance_mode = getattr(settings, 'MAINTENANCE_PAGE', None)
|
||||
if maintenance_mode:
|
||||
return
|
||||
return super().emit(record)
|
||||
|
||||
def format_subject(self, subject):
|
||||
from .models import Tenant
|
||||
|
||||
|
|
Loading…
Reference in New Issue