X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3f7228b204d935f82de397313e58989c738f2f47..9b533fdbfd08bd764744ae3a0d4717c87b61cf18:/src/catalogue/wikidata.py?ds=sidebyside diff --git a/src/catalogue/wikidata.py b/src/catalogue/wikidata.py index b5ce07b1..731e55f2 100644 --- a/src/catalogue/wikidata.py +++ b/src/catalogue/wikidata.py @@ -164,6 +164,10 @@ class WikidataModel(models.Model): except: pass else: + if isinstance(wdvalue, str): + max_length = getattr(model_field, 'max_length', None) + if max_length: + wdvalue = wdvalue[:max_length] setattr(self, attname, wdvalue) def wikidata_link(self):