Never use default constants. webmaster@localhost is never allowed to send emails.

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-06-07 23:49:46 +02:00
parent 4166823d55
commit 7b28938cde
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 3 deletions

View File

@ -4,7 +4,6 @@
import unicodedata import unicodedata
from django.conf import settings from django.conf import settings
from django.conf.global_settings import DEFAULT_FROM_EMAIL
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.core.mail import send_mail from django.core.mail import send_mail
from django.core.validators import RegexValidator from django.core.validators import RegexValidator
@ -190,8 +189,8 @@ class NoteClub(Note):
def send_mail_negative_balance(self): def send_mail_negative_balance(self):
plain_text = render_to_string("note/mails/negative_balance.txt", dict(note=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)) 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, send_mail("[Note Kfet] Passage en négatif (club {})".format(self.club.name), plain_text,
[self.club.email], html_message=html) settings.DEFAULT_FROM_EMAIL, [self.club.email], html_message=html)
class NoteSpecial(Note): class NoteSpecial(Note):