From: Radek Czajka Date: Wed, 31 Jan 2024 07:51:24 +0000 (+0100) Subject: fix X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/426f7aee276f1eba4d4f118edec96d0731c55eb9 fix --- diff --git a/src/documents/migrations/0015_project_logo_alt.py b/src/documents/migrations/0015_project_logo_alt.py new file mode 100644 index 00000000..5c862f2b --- /dev/null +++ b/src/documents/migrations/0015_project_logo_alt.py @@ -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), + ), + ] diff --git a/src/documents/models/book.py b/src/documents/models/book.py index fa93eeb9..e7803890 100644 --- a/src/documents/models/book.py +++ b/src/documents/models/book.py @@ -478,8 +478,10 @@ class Book(models.Model): 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)