Skip to content

Commit

Permalink
#58 fix parser
Browse files Browse the repository at this point in the history
  • Loading branch information
etj committed Apr 28, 2021
1 parent dcd879b commit 9dc7014
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rndt/layers/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,19 @@ def get_use_costraints(self, vals, acc_constr):
use_constr = item.find(util.nspath_eval("gmd:otherConstraints/gmx:Anchor", self.namespaces))
if use_constr is not None:
url = use_constr.attrib.get('{http://www.w3.org/1999/xlink}href')
t = ThesaurusKeyword.objects.filter(about=url).filter(thesaurus__identifier='ConditionsApplyingToAccessAndUse')
t = ThesaurusKeyword.objects\
.filter(about=url)\
.filter(thesaurus__identifier='ConditionsApplyingToAccessAndUse')
if t.exists():
vals['constraints_other'] = url
else:
vals['constraints_other'] = f"{use_constr.text} {acc_constr}"
else:
use_constrs = item.find(util.nspath_eval("gmd:otherConstraints/gco:CharacterString", self.namespaces)).text
vals['constraints_other'] = f"{use_constr.text} {acc_constr}"
use_constr = item.find(util.nspath_eval("gmd:otherConstraints/gco:CharacterString", self.namespaces))
if use_constr is not None:
vals['constraints_other'] = f"{use_constr.text} {acc_constr}"
else:
vals['constraints_other'] = acc_constr
return vals

def get_resolutions(self, custom):
Expand Down

0 comments on commit 9dc7014

Please sign in to comment.