diff --git a/preferences/forms.py b/preferences/forms.py index 02463103..ed3fefce 100644 --- a/preferences/forms.py +++ b/preferences/forms.py @@ -126,6 +126,8 @@ class EditGeneralOptionForm(ModelForm): self.fields['email_from'].label = "Adresse mail d\ 'expedition automatique" self.fields['GTU_sum_up'].label = "Résumé des CGU" + self.fields['all_mail_redirect'].label = "Redirection de tout les mails" + self.fields['redirect_address'].label = 'Adresse de redirection' class EditAssoOptionForm(ModelForm): diff --git a/preferences/migrations/0050_auto_20180817_1308.py b/preferences/migrations/0050_auto_20180817_1308.py new file mode 100644 index 00000000..f6cbd884 --- /dev/null +++ b/preferences/migrations/0050_auto_20180817_1308.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-17 11:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0049_optionaluser_self_change_shell'), + ] + + operations = [ + migrations.AddField( + model_name='generaloption', + name='all_mail_redirect', + field=models.BooleanField(default=True, help_text='Redirect all sent mail to the choosen address'), + ), + migrations.AddField( + model_name='generaloption', + name='redirect_address', + field=models.EmailField(default='no-reply@example.com', help_text='Where to redirect all mails', max_length=254), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index 0ebb2fec..671979d6 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -237,6 +237,8 @@ class GeneralOption(AclMixin, PreferencesModel): req_expire_hrs = models.IntegerField(default=48) site_name = models.CharField(max_length=32, default="Re2o") email_from = models.EmailField(default="www-data@example.com") + all_mail_redirect = models.BooleanField(default=True, help_text="Redirect all sent mail to the choosen address") + redirect_address = models.EmailField(default="no-reply@example.com", help_text="Where to redirect all mails") GTU_sum_up = models.TextField( default="", blank=True, diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index a7ada02b..55c07d00 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -160,6 +160,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,