Skip to content

Commit 2457351

Browse files
committed
Refer to settings variable directly
1 parent 7055d04 commit 2457351

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

contact/models.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from django.db import models
66
from django.utils.translation import gettext_lazy as _
77

8-
support_email = settings.DEFAULT_FROM_EMAIL
9-
108

119
class ContactEmail(models.Model):
1210
CHAPTER, SUPPORT = "chapter", "support"
@@ -43,7 +41,7 @@ def save(self, *args, **kwargs):
4341
email = EmailMessage(
4442
self._get_subject(),
4543
self.message,
46-
f"Django Girls Contact <{support_email}>",
44+
f"Django Girls Contact <{settings.DEFAULT_FROM_EMAIL}>",
4745
[self.sent_to],
4846
reply_to=[f"{self.name} <{self.email}>"],
4947
headers={"Reply-To": f"{self.name} <{self.email}>"},
@@ -58,7 +56,7 @@ def save(self, *args, **kwargs):
5856
def _get_to_email(self):
5957
if self.event and self.event.email:
6058
return self.event.email
61-
return support_email
59+
return settings.DEFAULT_FROM_EMAIL
6260

6361
def _get_subject(self):
6462
return f"{self.name} - from the djangogirls.org website"

organize/emails.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
from core.emails import send_email
55

6-
from_email = settings.DEFAULT_FROM_EMAIL
7-
86

97
def send_application_confirmation(event_application):
108
subject = f"Confirmation of application to organise Django Girls {event_application.city} workshop"
@@ -32,7 +30,7 @@ def send_application_notification(event_application):
3230
"application": event_application,
3331
},
3432
)
35-
send_email(content, subject, [from_email], reply_to=[event_application.get_main_organizer_email()])
33+
send_email(content, subject, [settings.DEFAULT_FROM_EMAIL], reply_to=[event_application.get_main_organizer_email()])
3634

3735

3836
def send_application_deployed_email(event_application, event, email_password):

0 commit comments

Comments
 (0)