Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Open311] Add --exclude to bin/open311-populate-service-list #5177

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- Cobrands can provide per-category custom distances for duplicate lookup. #4746 #5162
- Add perl 5.38 support.
- Add plain text template previews to /_dev/email. #5105
- Add --exclude option to bin/open311-populate-service-list
- Performance improvements:
- Reduce database queries on shortlist page.
- Provide ResultSet fallback translation in lookup.
Expand Down
4 changes: 4 additions & 0 deletions bin/open311-populate-service-list
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options(
'%c %o',
['body|b:s', "body name to only fetch this body"],
['exclude|e:s@', 'body name(s) to exclude from fetching' ],
['verbose|v', "print out all services as they are found"],
['warn|w', "output warnings about any issues"],
['help', "print usage message and exit" ],
Expand All @@ -29,6 +30,9 @@ my $bodies = FixMyStreet::DB->resultset('Body')->search( {
if ($opt->body) {
$bodies = $bodies->search({ name => $opt->body });
}
if (my $exclude = $opt->exclude) {
$bodies = $bodies->search({ name => { -not_in => $exclude } });
}

my $verbose = 0;
$verbose = 1 if $opt->warn;
Expand Down
Loading