diff options
-rw-r--r-- | perllib/Problems.pm | 5 | ||||
-rwxr-xr-x | web/json.cgi | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/perllib/Problems.pm b/perllib/Problems.pm index f34e4af9b..098572917 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -6,7 +6,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Problems.pm,v 1.15 2009-07-01 12:52:41 louise Exp $ +# $Id: Problems.pm,v 1.16 2009-07-01 13:02:07 louise Exp $ # package Problems; @@ -194,6 +194,9 @@ sub problems_matching_criteria{ if ($problem->{anonymous} == 1){ $problem->{name} = ''; } + if ($problem->{service} == ''){ + $problem->{service} = 'Web interface'; + } if ($problem->{council}) { $problem->{council} =~ s/\|.*//g; my @council_ids = split /,/, $problem->{council}; diff --git a/web/json.cgi b/web/json.cgi index 01ef2b8bb..8c6e2dd71 100755 --- a/web/json.cgi +++ b/web/json.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org. WWW: http://www.mysociety.org # -# $Id: json.cgi,v 1.2 2009-07-01 09:55:45 louise Exp $ +# $Id: json.cgi,v 1.3 2009-07-01 13:02:07 louise Exp $ use strict; use Error qw(:try); @@ -19,12 +19,12 @@ sub main { my $type = $q->param('type') || ''; my $start_date = $q->param('start_date') || ''; my $end_date = $q->param('end_date') || ''; - print $q->header( -type => 'application/json; charset=utf-8' ); if ($type eq 'new_problems'){ $problems = Problems::created_in_interval($start_date, $end_date); } elsif ($type eq 'fixed_problems') { $problems = Problems::fixed_in_interval($start_date, $end_date); } + print $q->header( -type => 'application/json; charset=utf-8' ); my $out = JSON::to_json($problems); print $out; } |