diff --git a/index.pl b/index.pl index 95f42c803643bac18fd14c235186871313bbb4b1..1af79a462d2a2abd726c9545156744ee0cea0db4 100755 --- a/index.pl +++ b/index.pl @@ -677,6 +677,9 @@ helper 'get_user_token' => sub { return; }; +# This helper should only be called directly when also providing a user ID. +# If you don't have one, use current_user() instead (get_user_data will +# delegate to it anyways). helper 'get_user_data' => sub { my ( $self, $uid ) = @_; diff --git a/templates/account.html.ep b/templates/account.html.ep index bbd68504bf06a8fe41165f8ca6c5c09f8c416a96..49179616f5782174220183f027ac34c23749298a 100644 --- a/templates/account.html.ep +++ b/templates/account.html.ep @@ -1,5 +1,5 @@ <h1>Account</h1> -% my $acc = get_user_data(); +% my $acc = current_user(); <div class="row"> <div class="col s12"> <table class="striped"> diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 588a83cac7d3c7706b323508db03c0da0d5a6dd6..8f5bdc241a14495d4023034da9017fc990abfa08 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -34,7 +34,7 @@ <div class="container"> % if (is_user_authenticated()) { - % my $acc = get_user_data(); + % my $acc = current_user(); % if ($acc and $acc->{deletion_requested}) { %= include '_deletion_note', timestamp => $acc->{deletion_requested} % }