aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App.pm9
-rw-r--r--perllib/FixMyStreet/App/Model/PhotoSet.pm9
2 files changed, 9 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 2fc560bc8..9660d327a 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -11,7 +11,7 @@ use FixMyStreet::Map;
use FixMyStreet::Email;
use Utils;
-use Path::Class;
+use Path::Tiny 'path';
use URI;
use URI::QueryParam;
@@ -103,6 +103,13 @@ after 'prepare_headers' => sub {
__PACKAGE__->log->disable('debug') #
unless __PACKAGE__->debug;
+# Check upload_dir
+my $cache_dir = path(FixMyStreet->config('UPLOAD_DIR'))->absolute(FixMyStreet->path_to());
+$cache_dir->mkpath;
+unless ( -d $cache_dir && -w $cache_dir ) {
+ warn "\x1b[31mCan't find/write to photo cache directory '$cache_dir'\x1b[0m\n";
+}
+
=head1 NAME
FixMyStreet::App - Catalyst based application
diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm
index 04521b5ce..8fcc1700e 100644
--- a/perllib/FixMyStreet/App/Model/PhotoSet.pm
+++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm
@@ -67,14 +67,7 @@ has upload_dir => (
is => 'ro',
lazy => 1,
default => sub {
- my $self = shift;
- my $cache_dir = path(FixMyStreet->config('UPLOAD_DIR'))->absolute(FixMyStreet->path_to());
- $cache_dir->mkpath;
- unless ( -d $cache_dir && -w $cache_dir ) {
- warn "Can't find/write to photo cache directory '$cache_dir'";
- return;
- }
- $cache_dir;
+ path(FixMyStreet->config('UPLOAD_DIR'))->absolute(FixMyStreet->path_to());
},
);