fix
authorRadek Czajka <rczajka@rczajka.pl>
Wed, 31 Jan 2024 07:51:24 +0000 (08:51 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Wed, 31 Jan 2024 07:51:24 +0000 (08:51 +0100)
src/documents/migrations/0015_project_logo_alt.py [new file with mode: 0644]
src/documents/models/book.py

diff --git a/src/documents/migrations/0015_project_logo_alt.py b/src/documents/migrations/0015_project_logo_alt.py
new file mode 100644 (file)
index 0000000..5c862f2
--- /dev/null
@@ -0,0 +1,18 @@
+# Generated by Django 4.1.9 on 2024-01-31 08:49
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("documents", "0014_project_logo_project_logo_mono"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="project",
+            name="logo_alt",
+            field=models.CharField(blank=True, max_length=255),
+        ),
+    ]
index fa93eeb..e780389 100644 (file)
@@ -478,8 +478,10 @@ class Book(models.Model):
                 if self.project.logo_mono:
                     data['logo_mono'] = urljoin(
                         'https://' + Site.objects.get_current().domain,
                 if self.project.logo_mono:
                     data['logo_mono'] = urljoin(
                         'https://' + Site.objects.get_current().domain,
-                        self.project.logo.url,
+                        self.project.logo_mono.url,
                     )
                     )
+                if self.project.logo_alt:
+                    data['logo_alt'] = self.project.logo_alt
             if host:
                 data['gallery_url'] = host + self.gallery_url()
             apiclient.api_call(user, "books/", data, beta=beta)
             if host:
                 data['gallery_url'] = host + self.gallery_url()
             apiclient.api_call(user, "books/", data, beta=beta)