X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4b200d823f0ec79279da035a46d0d888693ca2fe..2890d9e9df234b3e13fb0581337bc2d678ffdcb0:/src/catalogue/wikidata.py?ds=sidebyside diff --git a/src/catalogue/wikidata.py b/src/catalogue/wikidata.py index 90f1a5cb..b5ce07b1 100644 --- a/src/catalogue/wikidata.py +++ b/src/catalogue/wikidata.py @@ -159,7 +159,12 @@ class WikidataModel(models.Model): wdvalue = wdvalue.label.get(language, str(wdvalue.label)) if not skip_set: - setattr(self, attname, wdvalue) + try: + wdvalue = model_field.to_python(wdvalue) + except: + pass + else: + setattr(self, attname, wdvalue) def wikidata_link(self): if self.wikidata: