aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2008-10-09 14:30:24 +0000
committermatthew <matthew>2008-10-09 14:30:24 +0000
commit5673453de28c14378f367c6a1cbcd4e3c961d406 (patch)
tree9c0d3721380be1f4f9025dea59ddffb9bc185818
parent60dc3b2ddad999f628b777be27ee41100eb883c3 (diff)
Mandate property type, store council ID.
-rwxr-xr-xweb/index.cgi8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/index.cgi b/web/index.cgi
index 2aef65028..ce774c243 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.212 2008-10-09 14:20:54 matthew Exp $
+# $Id: index.cgi,v 1.213 2008-10-09 14:30:24 matthew Exp $
use strict;
use Standard;
@@ -242,7 +242,6 @@ sub submit_problem {
push @errors, $err if $err;
}
- $input{council} = -1 if $q->{site} eq 'emptyhomes'; # Not sent to council
$input{council} = 2260 if $q->{site} eq 'scambs'; # All reports go to S. Cambs
push(@errors, _('No council selected')) unless ($input{council} && $input{council} =~ /^(?:-1|[\d,]+(?:\|[\d,]+)?)$/);
@@ -261,6 +260,9 @@ sub submit_problem {
if ($input{category} && $input{category} eq '-- Pick a category --') {
push (@errors, _('Please choose a category'));
$input{category} = '';
+ } elsif ($input{category} && $input{category} eq '-- Pick a property type --') {
+ push (@errors, _('Please choose a property type'));
+ $input{category} = '';
}
return display_form($q, @errors) if (@errors); # Short circuit
@@ -293,7 +295,7 @@ sub submit_problem {
# Check category here, won't be present if council is -1
my @valid_councils = @input_councils;
- if ($input{category}) {
+ if ($input{category} && $q->{site} ne 'emptyhomes') {
my $categories = select_all("select area_id from contacts
where deleted='f' and area_id in ("
. $input{council} . ') and category = ?', $input{category});