diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-05-29 15:57:41 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-05-29 15:57:41 +0100 |
commit | 67da8efc720d2d0bd22bd9fe8655b7e983b35bb4 (patch) | |
tree | 38b8570647124df06c637d4b923f6010211ef328 /bin/kasabi | |
parent | 40b3a51d33caefa8f5fb97ce9be18ef936c7e260 (diff) | |
parent | 131ff6e9bf3626d6a8fff6ae54669d250148a63a (diff) |
Merge remote branch 'origin/master' into fmb-read-only
Conflicts:
bin/send-reports
perllib/FixMyStreet/Cobrand/Default.pm
perllib/FixMyStreet/Cobrand/FixMyStreet.pm
templates/web/fixmystreet/alert/index.html
templates/web/fixmystreet/around/display_location.html
web/cobrands/fixmystreet/_layout.scss
web/js/map-OpenLayers.js
Diffstat (limited to 'bin/kasabi')
-rwxr-xr-x | bin/kasabi | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/kasabi b/bin/kasabi index 5b99ba4ff..456b2f4d1 100755 --- a/bin/kasabi +++ b/bin/kasabi @@ -63,7 +63,7 @@ def main(): report['detail'] = tidy_string(report['detail']) report['confirmed'] = report['confirmed'].replace(microsecond=0).isoformat() # Don't want microseconds report['lastupdate'] = report['lastupdate'].replace(microsecond=0).isoformat() - report['council'] = sorted(re.sub('\|.*', '', report['council']).split(',')) # Remove missing councils + report['council'] = sorted(re.sub('\|.*', '', report['council'] or '').split(',')) # Remove missing councils # Fetch updates to note state changes states = [ { 'state': 'confirmed', 'time': report['confirmed'] } ] @@ -166,6 +166,7 @@ class FixMyStreetChangeSet(object): # Get info for the councils council_data = { 'sentTo': '', 'areaNames': [] } for council in report['council']: + if not council: continue js = json.load(urllib.urlopen('http://mapit.mysociety.org/area/{0}'.format(council))) os_id = int(js['codes']['unit_id']) + 7000000000000000 if report['whensent']: @@ -173,6 +174,7 @@ class FixMyStreetChangeSet(object): council_data['areaNames'].append(js['name']) council_data.setdefault('firstCouncil', council) council_data['areaNames'] = ' / '.join(council_data['areaNames']) + council_data.setdefault('firstCouncil', '0') # easting/northing |