diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/browser-tests | 4 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 1 | ||||
-rw-r--r-- | bin/import_categories | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/bin/browser-tests b/bin/browser-tests index 32b844127..e0b9bedfe 100755 --- a/bin/browser-tests +++ b/bin/browser-tests @@ -11,7 +11,7 @@ my ($cobrand, $coords, $area_id, $name, $mapit_url, $coverage); BEGIN { $config_file = 'conf/general.yml-example'; - $cobrand = [ 'borsetshire', 'fixmystreet', 'northamptonshire', 'bathnes', 'buckinghamshire', 'hounslow', 'isleofwight', 'peterborough', 'tfl' ]; + $cobrand = [ 'borsetshire', 'fixmystreet', 'northamptonshire', 'bathnes', 'buckinghamshire', 'hounslow', 'isleofwight', 'peterborough', 'tfl', 'hackney' ]; $coords = '51.532851,-2.284277'; $area_id = 2608; $name = 'Borsetshire'; @@ -190,7 +190,7 @@ browser-tests [running options] [fixture options] [cypress options] --help this help message Fixture option: - --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes,buckinghamshire,isleofwight,peterborough,tfl + --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes,buckinghamshire,isleofwight,peterborough,tfl,hackney --coords Default co-ordinates for created reports --area_id Area ID to use for created body --name Name to use for created body diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 082fc6309..e8dd3f364 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -99,6 +99,7 @@ if ($opt->test_fixtures) { { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' }, { area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' }, { area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' }, + { area_id => 2508, categories => [ 'Potholes', 'Other' ], name => 'Hackney Council' }, { area_id => 2636, categories => [ 'Potholes', 'Private', 'Extra' ], name => 'Isle of Wight Council' }, { area_id => 2566, categories => [ 'Fallen branch', 'Light Out', 'Light Dim', 'Fallen Tree', 'Damaged Tree' ], name => 'Peterborough City Council' }, { area_id => 2498, categories => [ 'Incorrect timetable', 'Glass broken', 'Mobile Crane Operation' ], name => 'TfL' }, diff --git a/bin/import_categories b/bin/import_categories index 744759f1f..23a1089f5 100644 --- a/bin/import_categories +++ b/bin/import_categories @@ -46,11 +46,10 @@ if (!$opt->commit) { my $config = decode_json(path($ARGV[0])->slurp_utf8); my $body = FixMyStreet::DB->resultset('Body')->find({ name => $opt->body }); +die "Couldn't find body " . $opt->body unless $body; $body->contacts->delete_all if $opt->delete; -die "Couldn't find body" unless $body; - my $groups = $config->{groups}; if ($groups) { for my $group (keys %$groups) { @@ -72,12 +71,14 @@ sub make_categories { category => $cat->{category} }); $child_cat->email($cat->{email}); + $child_cat->send_method($cat->{devolved}) if $cat->{devolved}; $child_cat->state('confirmed'); $child_cat->editor($0); $child_cat->whenedited(\'current_timestamp'); $child_cat->note($child_cat->in_storage ? 'Updated by import_categories' : 'Created by import_categories'); say colored("WARNING", 'red') . " " . $child_cat->category . " already exists" if $child_cat->in_storage and $child_cat->category ne 'Other (TfL)'; $child_cat->extra(undef) if $child_cat->in_storage; + $child_cat->set_extra_metadata(open311_protect => 1) if $cat->{open311_protect}; if ($group) { my $groups = $child_cat->groups; |