Handle accidental double-checkins
This commit is contained in:
parent
8a43c4073f
commit
531cb95c17
1 changed files with 8 additions and 2 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue