Handle accidental double-checkins

This commit is contained in:
Daniel Friesel 2019-05-20 18:59:28 +02:00
parent 8a43c4073f
commit 531cb95c17

View file

@ -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 );
}