X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/81f5e7445d649ead05b4d3d0a15b742444cd8b06..1ceb9c4f943943f72da281d4fdb7473d70dcdff9:/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'