Self hosted FLOSS fitness/workout, nutrition and weight tracker
Move EMAIL_FROM to WGER_SETTINGS dictionary
Roland Geider05306b9123ef
diff --git a/docs/settings.rst b/docs/settings.rstindex 90dd78bfa..111d44614 100644--- a/docs/settings.rst+++ b/docs/settings.rst@@ -19,6 +19,9 @@ dictionary in your settings file. Currently the following options are supported:middleware instead. Read the django documentation on the security implications(BREACH attack).+**EMAIL_FROM**: Default `wger Workout Manager <[email protected]>`+ The sender address used for sent emails by the system such as weight reminders+.. note::If you want to override a default setting, don't overwrite all the dictionarydiff --git a/wger/exercises/models.py b/wger/exercises/models.pyindex f4ed03d31..d160e01cd 100644--- a/wger/exercises/models.py+++ b/wger/exercises/models.py@@ -315,7 +315,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):message = render_to_string('exercise/email_new.html', context)mail.send_mail(subject,message,- settings.EMAIL_FROM,+ settings.WGER_SETTINGS['EMAIL_FROM'],[user.email],fail_silently=True)diff --git a/wger/gym/management/commands/inactive-members.py b/wger/gym/management/commands/inactive-members.pyindex 008243c0f..baf08f3d7 100644--- a/wger/gym/management/commands/inactive-members.py+++ b/wger/gym/management/commands/inactive-members.py@@ -101,6 +101,6 @@ class Command(BaseCommand):message = render_to_string('gym/email_inactive_members.html', context)mail.send_mail(subject,message,- settings.EMAIL_FROM,+ settings.WGER_SETTINGS['EMAIL_FROM'],[trainer.email],fail_silently=True)diff --git a/wger/manager/management/commands/email-reminders.py b/wger/manager/management/commands/email-reminders.pyindex 134a1243e..a5b3da7bd 100644--- a/wger/manager/management/commands/email-reminders.py+++ b/wger/manager/management/commands/email-reminders.py@@ -122,6 +122,6 @@ class Command(BaseCommand):message = loader.render_to_string('workout/email_reminder.tpl', context)mail.send_mail(subject,message,- settings.EMAIL_FROM,+ settings.WGER_SETTINGS['EMAIL_FROM'],[user.email],fail_silently=True)diff --git a/wger/nutrition/models.py b/wger/nutrition/models.pyindex c5436f401..21d56c47a 100644--- a/wger/nutrition/models.py+++ b/wger/nutrition/models.py@@ -430,7 +430,7 @@ class Ingredient(AbstractLicenseModel, models.Model):message = render_to_string('ingredient/email_new.html', context)mail.send_mail(subject,message,- settings.EMAIL_FROM,+ settings.WGER_SETTINGS['EMAIL_FROM'],[self.user.email],fail_silently=True)diff --git a/wger/settings.tpl b/wger/settings.tplindex e85ee5bf1..0f2ae5acb 100644--- a/wger/settings.tpl+++ b/wger/settings.tpl@@ -58,4 +58,4 @@ if DEBUG:EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'# Sender address used for sent emails-EMAIL_FROM = 'wger Workout Manager <[email protected]>'\ No newline at end of file+WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager <[email protected]>'diff --git a/wger/settings_global.py b/wger/settings_global.pyindex 4b1f6ecce..f15cd56a2 100644--- a/wger/settings_global.py+++ b/wger/settings_global.py@@ -348,5 +348,6 @@ IGNORABLE_404_URLS = (WGER_SETTINGS = {'USE_RECAPTCHA': False,'REMOVE_WHITESPACE': False,- 'ALLOW_REGISTRATION': True+ 'ALLOW_REGISTRATION': True,+ 'EMAIL_FROM': 'wger Workout Manager <[email protected]>'}diff --git a/wger/weight/management/commands/email-weight-reminder.py b/wger/weight/management/commands/email-weight-reminder.pyindex 9cb64596d..a868c1904 100644--- a/wger/weight/management/commands/email-weight-reminder.py+++ b/wger/weight/management/commands/email-weight-reminder.py@@ -79,6 +79,6 @@ class Command(BaseCommand):message = loader.render_to_string('workout/email_weight_reminder.tpl', context)mail.send_mail(subject,message,- settings.EMAIL_FROM,+ settings.WGER_SETTINGS['EMAIL_FROM'],[user.email],fail_silently=True)