Skip to content

Commit

Permalink
don't export empty redactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Perfilov committed Sep 2, 2015
1 parent 616daf9 commit 69b08ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext/datajson/package2pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ def generate_distribution(someValue):
for pod_key, json_map in distribution_map.iteritems():
value = strip_if_string(r.get(json_map.get('field'), json_map.get('default')))
if Wrappers.redaction_enabled:
if 'redacted_' + json_map.get('field') in r:
if 'redacted_' + json_map.get('field') in r and r.get('redacted_' + json_map.get('field')):
value = '[[REDACTED-EX ' + r.get('redacted_' + json_map.get('field')) + ']]'
if value:
resource[pod_key] = value

# inventory rules
res_url = strip_if_string(r.get('url'))
if Wrappers.redaction_enabled:
if 'redacted_url' in r:
if 'redacted_url' in r and r.get('redacted_url'):
res_url = '[[REDACTED-EX ' + r.get('redacted_url') + ']]'
if res_url:
res_url = res_url.replace('http://[[REDACTED', '[[REDACTED')
Expand Down

0 comments on commit 69b08ed

Please sign in to comment.