diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2019-03-31 19:32:41 +0200 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-31 19:32:41 +0200 | 
| commit | 3ce1cfc55f03ccb67b3bab13112d4594974552a4 (patch) | |
| tree | 256d536d98b49b586f357575d7d580ae2cddb7f4 /lib/Travelynx/Controller | |
| parent | 76f6922e825ea4f4f2ca0054bdd29ccd8e9edeca (diff) | |
Select journeys by ID
Diffstat (limited to 'lib/Travelynx/Controller')
| -rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index c3ce11e..70b2246 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -310,9 +310,9 @@ sub monthly_history {  sub journey_details {  	my ($self) = @_; -	my ( $uid, $checkin_ts, $checkout_ts ) = split( qr{-}, $self->stash('id') ); +	my ( $uid, $checkout_id ) = split( qr{-}, $self->stash('id') ); -	if ( $uid != $self->current_user->{id} ) { +	if ( not ($uid == $self->current_user->{id} and $checkout_id)) {  		$self->render(  			'journey',  			error   => 'notfound', @@ -323,11 +323,10 @@ sub journey_details {  	my @journeys = $self->get_user_travels(  		uid            => $uid, -		checkin_epoch  => $checkin_ts, -		checkout_epoch => $checkout_ts, +		checkout_id  => $checkout_id,  		verbose        => 1,  	); -	if ( @journeys == 0 ) { +	if ( @journeys == 0 or not $journeys[0]{completed}) {  		$self->render(  			'journey',  			error   => 'notfound', | 
