fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
27ed543
)
fix wikidata
author
Radek Czajka
<rczajka@rczajka.pl>
Tue, 23 Sep 2025 07:36:14 +0000
(09:36 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Tue, 23 Sep 2025 07:36:14 +0000
(09:36 +0200)
src/references/models.py
patch
|
blob
|
history
diff --git
a/src/references/models.py
b/src/references/models.py
index
d4733ff
..
24a6dad
100644
(file)
--- a/
src/references/models.py
+++ b/
src/references/models.py
@@
-31,6
+31,9
@@
class Entity(models.Model):
def populate_from_wikidata(self, wikidata_id):
client = Client()
def populate_from_wikidata(self, wikidata_id):
client = Client()
+ client.opener.addheaders = [(
+ 'User-Agent', 'Wolne Lektury / https://wolnelektury.pl / Python-wikidata'
+ )]
entity = client.get(wikidata_id)
self.label = entity.label.get('pl', entity.label) or ''
entity = client.get(wikidata_id)
self.label = entity.label.get('pl', entity.label) or ''