X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/81f5e7445d649ead05b4d3d0a15b742444cd8b06..ad422879d55a62e02c71024531aa4a2277dedaf3:/src/cover/utils.py?ds=sidebyside diff --git a/src/cover/utils.py b/src/cover/utils.py index 56fb24a7..6815d29d 100644 --- a/src/cover/utils.py +++ b/src/cover/utils.py @@ -99,7 +99,10 @@ def get_wikimedia_data(url): entity = client.get(qitem) meta['title'] = entity.label.get('pl', str(entity.label)) author = entity.get(client.get(WIKIDATA.CREATOR)) - meta['author'] = author.label.get('pl', str(author.label)) + if author is not None: + meta['author'] = author.label.get('pl', str(author.label)) + else: + meta['author'] = '' if meta['license_name'] == 'Public domain': meta['license_name'] = 'domena publiczna'