From 7b28938cde35a1f7dad238161cb6798f0c614d11 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Mon, 7 Jun 2021 23:49:46 +0200
Subject: [PATCH] Never use default constants. webmaster@localhost is never
 allowed to send emails.

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 apps/note/models/notes.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/apps/note/models/notes.py b/apps/note/models/notes.py
index 7b034d58..251e20bf 100644
--- a/apps/note/models/notes.py
+++ b/apps/note/models/notes.py
@@ -4,7 +4,6 @@
 import unicodedata
 
 from django.conf import settings
-from django.conf.global_settings import DEFAULT_FROM_EMAIL
 from django.core.exceptions import ValidationError
 from django.core.mail import send_mail
 from django.core.validators import RegexValidator
@@ -190,8 +189,8 @@ class NoteClub(Note):
     def send_mail_negative_balance(self):
         plain_text = render_to_string("note/mails/negative_balance.txt", dict(note=self))
         html = render_to_string("note/mails/negative_balance.html", dict(note=self))
-        send_mail("[Note Kfet] Passage en négatif (club {})".format(self.club.name), plain_text, DEFAULT_FROM_EMAIL,
-                  [self.club.email], html_message=html)
+        send_mail("[Note Kfet] Passage en négatif (club {})".format(self.club.name), plain_text,
+                  settings.DEFAULT_FROM_EMAIL, [self.club.email], html_message=html)
 
 
 class NoteSpecial(Note):
-- 
GitLab