Skip to content
Snippets Groups Projects
Commit b28b14e6 authored by Bodor Máté's avatar Bodor Máté
Browse files

Add default value to author

parent d4581e31
No related branches found
No related tags found
No related merge requests found
# 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'),
),
]
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment