From d7b22d05953c0f6380f44693d08d3cd92e40fb09 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 5 Apr 2019 09:40:45 +0200 Subject: [PATCH 1/1] Add aliases --- src/cas/settings.py | 1 + src/emails/__init__.py | 0 src/emails/admin.py | 9 +++++ src/emails/apps.py | 7 ++++ src/emails/locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 682 bytes src/emails/locale/pl/LC_MESSAGES/django.po | 41 +++++++++++++++++++++ src/emails/migrations/0001_initial.py | 27 ++++++++++++++ src/emails/migrations/__init__.py | 0 src/emails/models.py | 15 ++++++++ 9 files changed, 100 insertions(+) create mode 100644 src/emails/__init__.py create mode 100644 src/emails/admin.py create mode 100644 src/emails/apps.py create mode 100644 src/emails/locale/pl/LC_MESSAGES/django.mo create mode 100644 src/emails/locale/pl/LC_MESSAGES/django.po create mode 100644 src/emails/migrations/0001_initial.py create mode 100644 src/emails/migrations/__init__.py create mode 100644 src/emails/models.py diff --git a/src/cas/settings.py b/src/cas/settings.py index 935f972..4101776 100644 --- a/src/cas/settings.py +++ b/src/cas/settings.py @@ -84,6 +84,7 @@ LOCALE_PATHS = ( INSTALLED_APPS = ( 'accounts.apps.AccountsConfig', + 'emails.apps.EmailsConfig', 'services.apps.ServicesConfig', 'ssh_keys.apps.SshKeysConfig', diff --git a/src/emails/__init__.py b/src/emails/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/emails/admin.py b/src/emails/admin.py new file mode 100644 index 0000000..41372c0 --- /dev/null +++ b/src/emails/admin.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from . import models + + +class AliasAdmin(admin.ModelAdmin): + list_display = ['source', 'destination'] + + +admin.site.register(models.Alias, AliasAdmin) diff --git a/src/emails/apps.py b/src/emails/apps.py new file mode 100644 index 0000000..5ca33e9 --- /dev/null +++ b/src/emails/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig +from django.utils.translation import ugettext_lazy as _ + + +class EmailsConfig(AppConfig): + name = 'emails' + verbose_name = _('E-mails') diff --git a/src/emails/locale/pl/LC_MESSAGES/django.mo b/src/emails/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..20f93c78972894419bf59d5d062534c0ba6a6887 GIT binary patch literal 682 zcmYjOF>ezw6n1F=aosvIn1QMha`0W#s=4%1iISp9i5gV_v6{Qr!_~z;*$$#orY;>j zb?d+gBLWGjO9#}6jUT{o;W?M+`lRnZ`+eVgpLG7WwsJ+V9wDA0`iND;6yfVD;xXbI z;vwSu{Qe8s`)(0__7CFc5+Q$)z5n7t<-bJs`W5mr@-^}k@N#Srpo; z>anqqg(aepV*Uk7GO$i6;iOi?>WN8#42?d8)Um^iy#r%WiD_^Qr8bTYY%VkQYLZ(v z(%2pzv19loy@|aR4q_Vdu+4aj@h!^RaclDhk2nwd!a6oGLfJw%ZE&(LR6Y?oun~yy zy?ac{A{ZPFdUbf%1~uXZNx!gj5}xeiX)nOWuwS*iP;9StnpvPo+AO zDv#;T2kC-gF)^ZG2ilBnOjS9%+N9ONSg#}-DoH}RM>&n@hI$_IZW7V;b?T41Nvq+{ zvp(MqBRZYV1l|o%*`py2sb@I9Fm)4N4~Gr!pD*32`|Y}qX}EPBhk4c72-j{lI>CGP m1{9d;4-PeC($T2No7(}YUKj4a?iop;Aa^(B_mAxET$BGx)uYM) literal 0 HcmV?d00001 diff --git a/src/emails/locale/pl/LC_MESSAGES/django.po b/src/emails/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..a5c2125 --- /dev/null +++ b/src/emails/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +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" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" +"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" +"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" +"X-Generator: Poedit 2.0.6\n" + +#: apps.py:7 +msgid "E-mails" +msgstr "E-maile" + +#: models.py:6 +msgid "source" +msgstr "źródło" + +#: models.py:7 +msgid "destination" +msgstr "cel" + +#: models.py:10 +msgid "alias" +msgstr "alias" + +#: models.py:11 +msgid "aliases" +msgstr "aliasy" diff --git a/src/emails/migrations/0001_initial.py b/src/emails/migrations/0001_initial.py new file mode 100644 index 0000000..3ce50fa --- /dev/null +++ b/src/emails/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 2.2 on 2019-04-05 07:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Alias', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('source', models.EmailField(db_index=True, max_length=254, verbose_name='source')), + ('destination', models.EmailField(max_length=254, verbose_name='destination')), + ], + options={ + 'verbose_name': 'alias', + 'verbose_name_plural': 'aliases', + 'ordering': ('source', 'destination'), + }, + ), + ] diff --git a/src/emails/migrations/__init__.py b/src/emails/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/emails/models.py b/src/emails/models.py new file mode 100644 index 0000000..f44939f --- /dev/null +++ b/src/emails/models.py @@ -0,0 +1,15 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + + +class Alias(models.Model): + source = models.EmailField(_('source'), db_index=True) + destination = models.EmailField(_('destination')) + + class Meta: + verbose_name = _('alias') + verbose_name_plural = _('aliases') + ordering = ('source', 'destination') + + def __str__(self): + return '{} -> {}'.format(self.source, self.destination) -- 2.20.1