Upgrades.
authorRadek Czajka <rczajka@rczajka.pl>
Wed, 7 Jul 2021 08:49:09 +0000 (10:49 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Wed, 7 Jul 2021 08:49:09 +0000 (10:49 +0200)
requirements/requirements.txt
src/documents/migrations/0006_auto_20210706_0130.py [new file with mode: 0644]
src/documents/models/book.py
src/documents/models/chunk.py
src/documents/models/image.py
src/documents/tests/test_publish.py
src/redakcja/settings/__init__.py

index 3e363ce..ed33ac0 100644 (file)
@@ -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 (file)
index 0000000..a764019
--- /dev/null
@@ -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),
+        ),
+    ]
index 75e707e..42ea33a 100644 (file)
@@ -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):
index 39a2087..61aa517 100644 (file)
@@ -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()
index 10782dc..b05c928 100644 (file)
@@ -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'
index b59136a..c581389 100644 (file)
@@ -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
index c7cf324..d9d45e4 100644 (file)
@@ -117,7 +117,7 @@ STATICFILES_FINDERS = (
     'pipeline.finders.PipelineFinder',
 )
 
-STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
+STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
 
 PIPELINE = {
     'CSS_COMPRESSOR': None,