aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-05-11 16:06:37 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-05-26 23:02:03 +0100
commit72809e405e690c88d0e2011802820c9ba215ef61 (patch)
treed176a6d42a2e6df68324965537c24251c8ca80b1 /bin
parentc6e723a2fee40f7009de3f04de5870693e12889e (diff)
Consistent use of Contact groups.
Diffstat (limited to 'bin')
-rw-r--r--bin/import_categories2
-rwxr-xr-xbin/tfl/import_categories2
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/import_categories b/bin/import_categories
index 490e2187f..744759f1f 100644
--- a/bin/import_categories
+++ b/bin/import_categories
@@ -81,7 +81,7 @@ sub make_categories {
if ($group) {
my $groups = $child_cat->groups;
- my %groups = map { $_ => 1} @$groups;
+ my %groups = map { $_ => 1 } grep { $_ } @$groups;
$groups{$group} = 1;
my @groups = keys %groups;
$child_cat->set_extra_metadata(group => \@groups);
diff --git a/bin/tfl/import_categories b/bin/tfl/import_categories
index bb48ddc4e..d3b99547c 100755
--- a/bin/tfl/import_categories
+++ b/bin/tfl/import_categories
@@ -65,7 +65,7 @@ for my $group (keys %$groups) {
$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)';
my $groups = $child_cat->groups;
- my %groups = map { $_ => 1} @$groups;
+ my %groups = map { $_ => 1 } grep { $_ } @$groups;
$groups{$group} = 1;
my @groups = keys %groups;
$child_cat->extra(undef) if $child_cat->in_storage;