Resolve warnings

This commit is contained in:
Al Beano 2017-08-21 19:00:13 +01:00
parent fd9aae65ea
commit c204adbace
2 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,7 @@ hook 'before' => sub {
var email => $user->{"email"};
var config => config();
if (grep {$_ eq $user->{"stylesheet"}} @{ config->{"stylesheets"}->{"available"} }) {
if ($user->{"stylesheet"} && grep {$_ eq $user->{"stylesheet"}} @{ config->{"stylesheets"}->{"available"} }) {
var stylesheet => $user->{"stylesheet"};
} else {
var stylesheet => config->{"stylesheets"}->{"default"};

View File

@ -144,6 +144,9 @@ post '/account' => sub {
);
# Instant stylesheet update
if (!$user->{"stylesheet"}) {
$user->{"stylesheet"} = 0;
}
if ($user->{"stylesheet"} ne $newuser->{"stylesheet"}) {
return template 'redir' => {
"redir" => "account?updated=1",