Skip to content

Commit

Permalink
fix CSW 3 GetRecords parameter handling (#543) (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Sep 21, 2017
1 parent 310f2fd commit dfffb10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pycsw/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def __init__(self, prefix='csw30'):
},
'parameters': {
'typeNames': {
'values': ['csw:Record']
'values': ['csw:Record', 'csw30:Record']
},
'outputSchema': {
'values': ['http://www.opengis.net/cat/csw/3.0']
Expand Down
8 changes: 4 additions & 4 deletions pycsw/ogc/csw/csw3.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def getrecords(self):
'elementsetname',
'Missing one of ElementSetName or ElementName parameter(s)')

if 'elementsetname' in self.parent.kvp and 'elementname' in self.parent.kvp:
if 'elementsetname' in self.parent.kvp and 'elementname' in self.parent.kvp and self.parent.kvp['elementname']:
# mutually exclusive required
return self.exceptionreport('NoApplicableCode',
'elementsetname',
Expand Down Expand Up @@ -645,7 +645,7 @@ def getrecords(self):
if ofmt.split('/')[0] in self.parent.kvp['outputformat']:
LOGGER.debug('FOUND OUTPUT MATCH')
formats_match = True
if not formats_match:
if not formats_match and self.parent.environ['HTTP_ACCEPT'] != '*/*':
return self.exceptionreport('InvalidParameterValue',
'outputformat', 'HTTP Accept header (%s) and outputformat (%s) must agree' %
(self.parent.environ['HTTP_ACCEPT'], self.parent.kvp['outputformat']))
Expand Down Expand Up @@ -930,8 +930,8 @@ def getrecords(self):
try:
if (self.parent.kvp['outputschema'] ==
'http://www.opengis.net/cat/csw/3.0' and
'csw:Record' in self.parent.kvp['typenames']):
# serialize csw:Record inline
'csw30:Record' in self.parent.kvp['typenames']):
# serialize csw30:Record inline
searchresults.append(self._write_record(
res, self.parent.repository.queryables['_all']))
elif (self.parent.kvp['outputschema'] ==
Expand Down

0 comments on commit dfffb10

Please sign in to comment.