diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-05 11:40:13 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-10-09 11:17:07 +0100 |
commit | f738e18d1dc27aa1dbba0695a4d54d15ecd4cbf4 (patch) | |
tree | 1d2a6d90a5cdbaca03620a163a1b28c485e7706e | |
parent | 27040e8daa033d68d1e8eb0cf30fc0d854443af0 (diff) |
[FixMyStreet] add subcategories to fixture and enable for demo
The fixture script now generates subcategories so we need to turn these
on in the Borsetshire demo site so the categories make sense.
-rwxr-xr-x | bin/fixmystreet.com/fixture | 18 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Borsetshire.pm | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index c6c9b558e..8e943a5b5 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -46,6 +46,15 @@ my $body = FixMyStreet::DB::Factory::Body->find_or_create({ }); say "Created body " . $body->name . " for MapIt area ID " . $opt->area_id . ', categories ' . join(', ', @$categories); +for my $cat (qw/Overflowing Broken Missing/) { + my $child_cat = FixMyStreet::DB::Factory::Contact->find_or_create({ + body => $body, + category => $cat + }); + $child_cat->set_extra_metadata( group => 'Bins' ); + $child_cat->update; +} + FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Generic', text => 'Thank you for your report, we will be in touch with an update soon.' }); @@ -141,15 +150,6 @@ if ($opt->nonrandom) { }; } } - - for my $cat (qw/Overflowing Broken Missing/) { - my $child_cat = FixMyStreet::DB::Factory::Contact->find_or_create({ - body => $body, - category => $cat - }); - $child_cat->set_extra_metadata( group => 'Bins' ); - $child_cat->update; - } } else { for (1..$num) { $confirmed->add(seconds => rand(7000)); diff --git a/perllib/FixMyStreet/Cobrand/Borsetshire.pm b/perllib/FixMyStreet/Cobrand/Borsetshire.pm index d9b018d69..44a4a9162 100644 --- a/perllib/FixMyStreet/Cobrand/Borsetshire.pm +++ b/perllib/FixMyStreet/Cobrand/Borsetshire.pm @@ -31,4 +31,6 @@ sub send_questionnaires { sub bypass_password_checks { 1 } +sub enable_category_groups { 1 } + 1; |