From: Radek Czajka Date: Wed, 7 Jul 2021 08:49:09 +0000 (+0200) Subject: Upgrades. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/8a9226b9c80c99c82702fba212f7a7241dc14c7e Upgrades. --- diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 3e363cec..ed33ac02 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,7 +1,7 @@ -i https://py.mdrn.pl/simple ## Python libraries -merge3==0.0.2 +merge3==0.0.8 PyYAML>=3.0 Pillow oauth2 @@ -13,18 +13,18 @@ Wikidata==0.6.1 librarian==1.10 ## Django -Django==3.0.14 -fnpdjango==0.4.5 -django-pipeline==1.7.0 # + -django-cas-ng==4.1.1 # + -sorl-thumbnail==12.6.3 # + +Django==3.1.13 +fnpdjango==0.5 +django-pipeline==2.0.5 +django-cas-ng==4.2.1 +sorl-thumbnail==12.7.0 django-maintenancemode>=0.9 fnp-django-pagination==2.2.4 -django-gravatar2==1.4.2 -django-extensions==2.1.6 -django-bootstrap4==1.1.1 # + -libsasscompiler==0.1.5 -django-debug-toolbar==2.2 # + +django-gravatar2==1.4.4 +django-extensions==3.1.3 +django-bootstrap4==3.0.1 +libsasscompiler==0.1.8 +django-debug-toolbar==3.2.1 django-admin-numeric-filter==0.1.6 sentry-sdk==0.12.2 diff --git a/src/documents/migrations/0006_auto_20210706_0130.py b/src/documents/migrations/0006_auto_20210706_0130.py new file mode 100644 index 00000000..a7640192 --- /dev/null +++ b/src/documents/migrations/0006_auto_20210706_0130.py @@ -0,0 +1,58 @@ +# Generated by Django 3.1.13 on 2021-07-06 01:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('documents', '0005_auto_20201102_1340'), + ] + + operations = [ + migrations.AlterField( + model_name='book', + name='_new_publishable', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='book', + name='_published', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='book', + name='_single', + field=models.BooleanField(db_index=True, editable=False, null=True), + ), + migrations.AlterField( + model_name='chunk', + name='_changed', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='chunk', + name='_hidden', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='chunk', + name='_new_publishable', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='image', + name='_changed', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='image', + name='_new_publishable', + field=models.BooleanField(editable=False, null=True), + ), + migrations.AlterField( + model_name='image', + name='_published', + field=models.BooleanField(editable=False, null=True), + ), + ] diff --git a/src/documents/models/book.py b/src/documents/models/book.py index 75e707e8..42ea33a1 100644 --- a/src/documents/models/book.py +++ b/src/documents/models/book.py @@ -34,9 +34,9 @@ class Book(models.Model): parent_number = models.IntegerField(_('parent number'), null=True, blank=True, db_index=True, editable=False) # Cache - _single = models.NullBooleanField(editable=False, db_index=True) - _new_publishable = models.NullBooleanField(editable=False) - _published = models.NullBooleanField(editable=False) + _single = models.BooleanField(editable=False, null=True, db_index=True) + _new_publishable = models.BooleanField(editable=False, null=True) + _published = models.BooleanField(editable=False, null=True) _on_track = models.IntegerField(null=True, blank=True, db_index=True, editable=False) dc_cover_image = models.ForeignKey(Image, blank=True, null=True, db_index=True, on_delete=models.SET_NULL, editable=False) @@ -350,10 +350,8 @@ class Book(models.Model): } info = self.book_info() - print(info) if info is not None: update['catalogue_book_id'] = info.url.slug - print(info.url.slug) if info.cover_source: try: image = Image.objects.get(pk=int(info.cover_source.rstrip('/').rsplit('/', 1)[-1])) @@ -362,7 +360,6 @@ class Book(models.Model): else: if info.cover_source == image.get_full_url(): update['dc_cover_image'] = image - print(update) Book.objects.filter(pk=self.pk).update(**update) def touch(self): diff --git a/src/documents/models/chunk.py b/src/documents/models/chunk.py index 39a20871..61aa5177 100644 --- a/src/documents/models/chunk.py +++ b/src/documents/models/chunk.py @@ -23,9 +23,9 @@ class Chunk(dvcs_models.Document): gallery_start = models.IntegerField(_('gallery start'), null=True, blank=True, default=1) # cache - _hidden = models.NullBooleanField(editable=False) - _changed = models.NullBooleanField(editable=False) - _new_publishable = models.NullBooleanField(editable=False) + _hidden = models.BooleanField(editable=False, null=True) + _changed = models.BooleanField(editable=False, null=True) + _new_publishable = models.BooleanField(editable=False, null=True) # managers objects = models.Manager() diff --git a/src/documents/models/image.py b/src/documents/models/image.py index 10782dcf..b05c9288 100644 --- a/src/documents/models/image.py +++ b/src/documents/models/image.py @@ -23,9 +23,9 @@ class Image(dvcs_models.Document): project = models.ForeignKey(Project, models.SET_NULL, null=True, blank=True) # cache - _new_publishable = models.NullBooleanField(editable=False) - _published = models.NullBooleanField(editable=False) - _changed = models.NullBooleanField(editable=False) + _new_publishable = models.BooleanField(editable=False, null=True) + _published = models.BooleanField(editable=False, null=True) + _changed = models.BooleanField(editable=False, null=True) class Meta: app_label = 'documents' diff --git a/src/documents/tests/test_publish.py b/src/documents/tests/test_publish.py index b59136a1..c5813891 100644 --- a/src/documents/tests/test_publish.py +++ b/src/documents/tests/test_publish.py @@ -5,7 +5,7 @@ from documents.test_utils import get_fixture -from mock import patch +from unittest.mock import patch from django.test import TestCase from django.contrib.auth.models import User from documents.models import Book diff --git a/src/redakcja/settings/__init__.py b/src/redakcja/settings/__init__.py index c7cf3244..d9d45e45 100644 --- a/src/redakcja/settings/__init__.py +++ b/src/redakcja/settings/__init__.py @@ -117,7 +117,7 @@ STATICFILES_FINDERS = ( 'pipeline.finders.PipelineFinder', ) -STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' +STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage' PIPELINE = { 'CSS_COMPRESSOR': None,