From: Radek Czajka Date: Mon, 2 Nov 2020 13:03:53 +0000 (+0100) Subject: fix X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/7518020e7db372ad8bbb13fb24c99931c4e90aff fix --- diff --git a/src/documents/migrations/0003_auto_20201102_1324.py b/src/documents/migrations/0003_auto_20201102_1324.py index 79c30738..5292fa6f 100644 --- a/src/documents/migrations/0003_auto_20201102_1324.py +++ b/src/documents/migrations/0003_auto_20201102_1324.py @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='book', name='dc_slug', - field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='catalogue.Book', to_field='slug'), + field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='catalogue.Book', to_field='slug', db_constraint=False), ), ] diff --git a/src/documents/migrations/0005_auto_20201102_1340.py b/src/documents/migrations/0005_auto_20201102_1340.py index 0731fa83..eb6e493d 100644 --- a/src/documents/migrations/0005_auto_20201102_1340.py +++ b/src/documents/migrations/0005_auto_20201102_1340.py @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='book', name='catalogue_book', - field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='document_books', related_query_name='document_book', to='catalogue.Book', to_field='slug'), + field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='document_books', related_query_name='document_book', to='catalogue.Book', to_field='slug', db_constraint=False), ), ] diff --git a/src/documents/models/book.py b/src/documents/models/book.py index e16de686..75e707e8 100644 --- a/src/documents/models/book.py +++ b/src/documents/models/book.py @@ -45,6 +45,7 @@ class Book(models.Model): models.DO_NOTHING, to_field='slug', null=True, blank=True, + db_constraint=False, editable=False, db_index=True, related_name='document_books', related_query_name='document_book',