Use thema from audience.
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 24 Aug 2023 10:27:50 +0000 (12:27 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 24 Aug 2023 10:27:50 +0000 (12:27 +0200)
src/depot/publishers/woblink.py

index 4cbc89e..e98ec58 100644 (file)
@@ -220,6 +220,12 @@ class Woblink(BasePublisher):
             if errors is not None:
                 errors.append(NoMainThemaWarning())
         thema_codes.extend(meta.thema)
             if errors is not None:
                 errors.append(NoMainThemaWarning())
         thema_codes.extend(meta.thema)
+
+        thema_codes.extend(
+            Audience.objects.filter(code__in=meta.audiences).exclude(
+                thema=None).values_list('thema', flat=True)
+        )
+
         if not thema_codes:
             if errors is not None:
                 errors.append(NoThema())
         if not thema_codes:
             if errors is not None:
                 errors.append(NoThema())