From ce3a088a24f78189c165ff00b617f0d073a31d3b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 15 May 2020 16:21:56 +0200 Subject: [PATCH] models: make Journal.actor nullable --- .../migrations/0005_auto_20200515_1616.py | 22 +++++++++++++++++++ src/authentic2_cut/models.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/authentic2_cut/migrations/0005_auto_20200515_1616.py diff --git a/src/authentic2_cut/migrations/0005_auto_20200515_1616.py b/src/authentic2_cut/migrations/0005_auto_20200515_1616.py new file mode 100644 index 0000000..9223af1 --- /dev/null +++ b/src/authentic2_cut/migrations/0005_auto_20200515_1616.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-05-15 14:16 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentic2_cut', '0004_auto_20180801_1147'), + ] + + operations = [ + migrations.AlterField( + model_name='journal', + name='actor', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='actor_journal', to=settings.AUTH_USER_MODEL, verbose_name='Auteur'), + ), + ] diff --git a/src/authentic2_cut/models.py b/src/authentic2_cut/models.py index 4a5e53a..eae5468 100644 --- a/src/authentic2_cut/models.py +++ b/src/authentic2_cut/models.py @@ -25,6 +25,7 @@ class Journal(models.Model): auto_now_add=True) actor = models.ForeignKey( settings.AUTH_USER_MODEL, + null=True, verbose_name=u'Auteur', related_name='actor_journal', on_delete=models.SET_NULL)