From: Radek Czajka Date: Fri, 5 Apr 2019 09:34:48 +0000 (+0200) Subject: Add mode. X-Git-Url: https://git.mdrn.pl/cas.git/commitdiff_plain/53c0f2de2c0447a5b7518e1a0ac2d09461930ae8?ds=sidebyside;hp=d7b22d05953c0f6380f44693d08d3cd92e40fb09 Add mode. --- diff --git a/src/emails/admin.py b/src/emails/admin.py index 41372c0..fee152d 100644 --- a/src/emails/admin.py +++ b/src/emails/admin.py @@ -3,7 +3,9 @@ from . import models class AliasAdmin(admin.ModelAdmin): - list_display = ['source', 'destination'] + search_fields = ['source', 'destination'] + list_display = ['source', 'destination', 'mode'] + list_filter = ['mode'] admin.site.register(models.Alias, AliasAdmin) diff --git a/src/emails/locale/pl/LC_MESSAGES/django.mo b/src/emails/locale/pl/LC_MESSAGES/django.mo index 20f93c7..55a8ea7 100644 Binary files a/src/emails/locale/pl/LC_MESSAGES/django.mo and b/src/emails/locale/pl/LC_MESSAGES/django.mo differ diff --git a/src/emails/locale/pl/LC_MESSAGES/django.po b/src/emails/locale/pl/LC_MESSAGES/django.po index a5c2125..df146cb 100644 --- a/src/emails/locale/pl/LC_MESSAGES/django.po +++ b/src/emails/locale/pl/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-04-05 09:43+0200\n" -"PO-Revision-Date: 2019-04-05 09:43+0200\n" +"POT-Creation-Date: 2019-04-05 11:31+0200\n" +"PO-Revision-Date: 2019-04-05 11:31+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: pl\n" @@ -32,10 +32,22 @@ msgstr "źródło" msgid "destination" msgstr "cel" +#: models.py:8 +msgid "mode" +msgstr "tryb" + +#: models.py:9 +msgid "Forward everything" +msgstr "Przekazuj wszystko" + #: models.py:10 +msgid "Do not forward e-mail marked as spam." +msgstr "Nie przekazuj wiadomości oznaczonych jako spam." + +#: models.py:14 msgid "alias" msgstr "alias" -#: models.py:11 +#: models.py:15 msgid "aliases" msgstr "aliasy" diff --git a/src/emails/migrations/0002_alias_mode.py b/src/emails/migrations/0002_alias_mode.py new file mode 100644 index 0000000..573fb30 --- /dev/null +++ b/src/emails/migrations/0002_alias_mode.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2019-04-05 09:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('emails', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='alias', + name='mode', + field=models.CharField(blank=True, choices=[('', 'Forward everything'), ('@FORWARD', 'Do not forward e-mail marked as spam.')], default='', max_length=255, verbose_name='mode'), + ), + ] diff --git a/src/emails/models.py b/src/emails/models.py index f44939f..988b5a1 100644 --- a/src/emails/models.py +++ b/src/emails/models.py @@ -5,6 +5,11 @@ from django.utils.translation import ugettext_lazy as _ class Alias(models.Model): source = models.EmailField(_('source'), db_index=True) destination = models.EmailField(_('destination')) + mode = models.CharField( + _('mode'), max_length=255, default='', blank=True, choices=[ + ('', _('Forward everything')), + ('@FORWARD', _('Do not forward e-mail marked as spam.')) + ]) class Meta: verbose_name = _('alias')