diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-05-20 18:59:28 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-05-20 18:59:28 +0200 |
commit | 531cb95c1773fe459a2ef4c9f2adc8d89e75a62d (patch) | |
tree | ecd094bc47cd47dc8179acd3cbd8a506cc175425 | |
parent | 8a43c4073f7912759a9ba24bac17979b9e18e489 (diff) |
Handle accidental double-checkins1.5.1
-rwxr-xr-x | lib/Travelynx.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index ff75898..d313b25 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -332,8 +332,14 @@ sub startup { my $user = $self->get_user_status; if ( $user->{checked_in} or $user->{cancelled} ) { - # If a user is already checked in, we assume that they forgot to - # check out and do it for them. + if ( $user->{train_id} eq $train_id + and $user->{dep_ds100} eq $status->{station_ds100} ) + { + # checking in twice is harmless + return ( $train, undef ); + } + + # Otherwise, someone forgot to check out first $self->checkout( $station, 1 ); } |