Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

safeguard layer.supplemental_information

  • Loading branch information...
commit 0c976696fc31b906982cf9bcf0c42ea4d20f3d38 1 parent b96b80a
@tomkralidis tomkralidis authored
Showing with 8 additions and 5 deletions.
  1. +5 −3 geonode/layers/metadata.py
  2. +3 −2 geonode/tests/integration.py
View
8 geonode/layers/metadata.py
@@ -81,8 +81,9 @@ def iso2dict(exml):
vals['title'] = mdata.identification.title
vals['abstract'] = mdata.identification.abstract
vals['purpose'] = mdata.identification.purpose
- vals['supplemental_information'] = \
- mdata.identification.supplementalinformation
+ if mdata.identification.supplementalinformation is not None:
+ vals['supplemental_information'] = \
+ mdata.identification.supplementalinformation
vals['temporal_extent_start'] = \
mdata.identification.temporalextent_start
@@ -131,7 +132,8 @@ def fgdc2dict(exml):
if hasattr(mdata.idinfo, 'descript'):
vals['abstract'] = mdata.idinfo.descript.abstract
vals['purpose'] = mdata.idinfo.descript.purpose
- vals['supplemental_information'] = mdata.idinfo.descript.supplinf
+ if mdata.idinfo.descript.supplinf is not None:
+ vals['supplemental_information'] = mdata.idinfo.descript.supplinf
if hasattr(mdata.idinfo, 'keywords'):
if mdata.idinfo.keywords.theme:
View
5 geonode/tests/integration.py
@@ -246,9 +246,10 @@ def test_layer_upload_metadata(self):
'and Runways within San Diego County',
'Expected specific purpose from uploaded layer XML metadata')
- assert uploaded.supplemental_information is None, \
+ self.assertEqual(uploaded.supplemental_information,
+ 'No information provided',
'Expected specific supplemental information '\
- 'from uploaded layer XML metadata'
+ 'from uploaded layer XML metadata')
self.assertEqual(len(uploaded.keyword_list()), 5,
'Expected specific number of keywords from uploaded layer XML metadata')
Please sign in to comment.
Something went wrong with that request. Please try again.