From 491b43c5fbefd8868aee887ed4ccd61cd18fcdc3 Mon Sep 17 00:00:00 2001 From: Matthew Connelly Date: Sat, 14 Nov 2015 07:14:11 +0000 Subject: [PATCH] minor layout change to make the default expiry match the configured default also remove redundant undef in getpaste --- config.yml | 3 +++ lib/App/WerePaste.pm | 2 +- views/index.tt | 11 ++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index e0fefed..fd601ab 100644 --- a/config.yml +++ b/config.yml @@ -32,6 +32,9 @@ show_errors: 1 expiration: weeks: 2 +strings: + default_expiry: "Two weeks" + # Languages supported by Pygments # TODO: perhaps swap this out with something in App::WerePaste::Util::PygmentsBridge so we can dynamically load supported languages diff --git a/lib/App/WerePaste.pm b/lib/App/WerePaste.pm index e63f6e6..89f2d88 100644 --- a/lib/App/WerePaste.pm +++ b/lib/App/WerePaste.pm @@ -51,7 +51,7 @@ sub ValidateParams { sub GetPaste { my $id = shift; $id = lc $id; return undef unless $id =~ /^[a-f0-9]*$/; - return schema->resultset('Paste')->single({ id => $id }) || undef; + return schema->resultset('Paste')->single({ id => $id }); } sub StorePaste { my $params = shift; diff --git a/views/index.tt b/views/index.tt index bbf750d..2e90a00 100644 --- a/views/index.tt +++ b/views/index.tt @@ -17,13 +17,14 @@