Browse Source

jout de l'option de redirection des mails

override_mails
grisel-davy 7 years ago
parent
commit
9df9149894
  1. 2
      preferences/forms.py
  2. 25
      preferences/migrations/0050_auto_20180817_1308.py
  3. 2
      preferences/models.py
  4. 8
      preferences/templates/preferences/display_preferences.html

2
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):

25
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),
),
]

2
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,

8
preferences/templates/preferences/display_preferences.html

@ -160,6 +160,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>CGU</th>
<td>{{generaloptions.GTU}}</th>
</tr>
</tr>
<th>Redirection des mails envoyés</th>
<td>{{ generaloptions.all_mail_redirect|tick }}</td>
{% if generaloptions.all_mail_redirect %}
<th> Adresse mail de redirection <th>
<td>{{ generaloptions.redirect_address }}</td>
{% endif %}
</tr>
</table>

Loading…
Cancel
Save