diff --git a/src/news/migrations/0002_auto_20181229_2019.py b/src/news/migrations/0002_auto_20181229_2019.py new file mode 100644 index 0000000000000000000000000000000000000000..07d22c2d508deb673d4c75b1ab6eef8c977262b1 --- /dev/null +++ b/src/news/migrations/0002_auto_20181229_2019.py @@ -0,0 +1,20 @@ +# Generated by Django 2.0.1 on 2018-12-29 19:19 + +import common.middleware +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='article', + name='author', + field=models.ForeignKey(default=common.middleware.CurrentUserMiddleware.get_current_user_profile, on_delete=django.db.models.deletion.DO_NOTHING, related_name='author', to='account.Profile'), + ), + ] diff --git a/src/news/models.py b/src/news/models.py index 92552b7d95f8f3012f12056ce54d821165cd3717..d405a078ec5167c34bb7d72df005e35916059566 100644 --- a/src/news/models.py +++ b/src/news/models.py @@ -8,7 +8,7 @@ class Article(models.Model): Profile, related_name="author", on_delete=models.DO_NOTHING, - default=CurrentUserMiddleware.get_current_profile(), + default=CurrentUserMiddleware.get_current_user_profile, ) title = models.CharField(null=False, max_length=200) text = models.TextField()