summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-20 18:59:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-20 18:59:28 +0200
commit531cb95c1773fe459a2ef4c9f2adc8d89e75a62d (patch)
treeecd094bc47cd47dc8179acd3cbd8a506cc175425 /lib
parent8a43c4073f7912759a9ba24bac17979b9e18e489 (diff)
Handle accidental double-checkins1.5.1
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm10
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 );
}