history: return 404 if no journeys have been logged for requested period
This commit is contained in:
parent
127b40c27a
commit
d256a1956a
1 changed files with 14 additions and 0 deletions
|
@ -1473,6 +1473,13 @@ sub yearly_history {
|
|||
before => $interval_end,
|
||||
with_datetime => 1
|
||||
);
|
||||
|
||||
if ( not @journeys ) {
|
||||
$self->render( 'not_found',
|
||||
message => 'Keine Zugfahrten im angefragten Jahr gefunden.' );
|
||||
return;
|
||||
}
|
||||
|
||||
$stats = $self->journeys->get_stats(
|
||||
uid => $self->current_user->{id},
|
||||
year => $year
|
||||
|
@ -1534,6 +1541,13 @@ sub monthly_history {
|
|||
before => $interval_end,
|
||||
with_datetime => 1
|
||||
);
|
||||
|
||||
if ( not @journeys ) {
|
||||
$self->render( 'not_found',
|
||||
message => 'Keine Zugfahrten im angefragten Monat gefunden.' );
|
||||
return;
|
||||
}
|
||||
|
||||
$stats = $self->journeys->get_stats(
|
||||
uid => $self->current_user->{id},
|
||||
year => $year,
|
||||
|
|
Loading…
Reference in a new issue