diff --git a/com/migrations/0003_auto_20170103_1341.py b/com/migrations/0003_auto_20170115_2300.py similarity index 64% rename from com/migrations/0003_auto_20170103_1341.py rename to com/migrations/0003_auto_20170115_2300.py index ebcddb20..660c7635 100644 --- a/com/migrations/0003_auto_20170103_1341.py +++ b/com/migrations/0003_auto_20170115_2300.py @@ -8,8 +8,8 @@ from django.conf import settings class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('club', '0006_auto_20161229_0040'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('com', '0002_news_newsdate'), ] @@ -17,8 +17,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Weekmail', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), - ('title', models.CharField(verbose_name='title', max_length=64)), + ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), + ('title', models.CharField(max_length=64, verbose_name='title', blank=True)), ('intro', models.TextField(verbose_name='intro', blank=True)), ('joke', models.TextField(verbose_name='joke', blank=True)), ('protip', models.TextField(verbose_name='protip', blank=True)), @@ -32,13 +32,13 @@ class Migration(migrations.Migration): migrations.CreateModel( name='WeekmailArticle', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), - ('title', models.CharField(verbose_name='title', max_length=64)), + ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), + ('title', models.CharField(max_length=64, verbose_name='title')), ('content', models.TextField(verbose_name='content')), ('rank', models.IntegerField(verbose_name='rank', default=-1)), - ('author', models.ForeignKey(related_name='owned_weekmail_articles', to=settings.AUTH_USER_MODEL, verbose_name='author')), - ('club', models.ForeignKey(related_name='weekmail_articles', to='club.Club', verbose_name='club')), - ('weekmail', models.ForeignKey(related_name='articles', to='com.Weekmail', verbose_name='weekmail')), + ('author', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='author', related_name='owned_weekmail_articles')), + ('club', models.ForeignKey(to='club.Club', verbose_name='club', related_name='weekmail_articles')), + ('weekmail', models.ForeignKey(to='com.Weekmail', verbose_name='weekmail', related_name='articles', null=True)), ], ), migrations.AddField( diff --git a/com/migrations/0004_auto_20170107_1222.py b/com/migrations/0004_auto_20170107_1222.py deleted file mode 100644 index 41d8bcec..00000000 --- a/com/migrations/0004_auto_20170107_1222.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('com', '0003_auto_20170103_1341'), - ] - - operations = [ - migrations.AlterField( - model_name='weekmail', - name='title', - field=models.CharField(verbose_name='title', max_length=64, blank=True), - ), - migrations.AlterField( - model_name='weekmailarticle', - name='weekmail', - field=models.ForeignKey(related_name='articles', to='com.Weekmail', verbose_name='weekmail', null=True), - ), - ] diff --git a/com/models.py b/com/models.py index 34ea514a..3b6ca542 100644 --- a/com/models.py +++ b/com/models.py @@ -84,6 +84,7 @@ class Weekmail(models.Model): def send(self): dest = [i[0] for i in Preferences.objects.filter(receive_weekmail=True).values_list('user__email')] + print(dest) with transaction.atomic(): email = EmailMultiAlternatives( subject=self.title, diff --git a/com/templates/com/weekmail_renderer_html.jinja b/com/templates/com/weekmail_renderer_html.jinja index 1b6c518c..37a9bc50 100644 --- a/com/templates/com/weekmail_renderer_html.jinja +++ b/com/templates/com/weekmail_renderer_html.jinja @@ -1,34 +1,46 @@ -