diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-09-25 22:35:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-12-02 17:41:35 +0000 |
commit | 55412b79394ff1b1cabe368aed67fa8f68680ecc (patch) | |
tree | 33657093517818b8ba60f156484ec540f9c4af17 /bin/zurich/convert_internal_notes_to_comments | |
parent | 0c2a792b154e1b28528db887bbde80b19268b9fe (diff) |
Reduce use of FixMyStreet::App.
Command line scripts don't need a full blown app, just database.
Diffstat (limited to 'bin/zurich/convert_internal_notes_to_comments')
-rwxr-xr-x | bin/zurich/convert_internal_notes_to_comments | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/zurich/convert_internal_notes_to_comments b/bin/zurich/convert_internal_notes_to_comments index ddf74851f..76db0a45b 100755 --- a/bin/zurich/convert_internal_notes_to_comments +++ b/bin/zurich/convert_internal_notes_to_comments @@ -17,15 +17,13 @@ the superuser, or one created just for this purpose? use strict; use warnings; -use FixMyStreet::App; +use FixMyStreet::DB; # Because it is not possible to determine the user that last edited the # internal_notes we need require a user to assign all the comments to. my $comment_user_id = $ARGV[0] || die "Usage: $0 id_of_user_for_comments"; -my $comment_user = FixMyStreet::App # - ->model('DB::User') # - ->find($comment_user_id) +my $comment_user = FixMyStreet::DB->resultset('User')->find($comment_user_id) || die "Could not find user with id '$comment_user_id'"; # We use now as the time for the internal note. This is not the time it was @@ -39,7 +37,7 @@ my $comment_state = 'hidden'; # Load all the comments, more reliable than trying to search on the contents of # the extra field. -my $problems = FixMyStreet::App->model('DB::Problem')->search(); +my $problems = FixMyStreet::DB->resultset('Problem')->search(); while ( my $problem = $problems->next() ) { |