Compare commits

...

4 Commits

Author SHA1 Message Date
f08d9728eb Merge pull request 'require-user-for-logentry' (#450) from require-user-for-logentry into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m57s
CI/CD Pipeline / deploy-staging (push) Successful in 6m0s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #450
2024-04-28 19:25:27 +02:00
c27a2ad15e don't respond with 500 if no rower is selected
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m43s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-04-28 19:16:38 +02:00
18047d16bf Merge pull request 'fix spacing if boat was steered by hand' (#447) from fix-spacing into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 7m44s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m32s
Reviewed-on: #447
2024-04-26 10:07:03 +02:00
e2306e890d Merge pull request 'if user is logged in, use that user as default rower' (#445) from prefill-own-user-default-log into main
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
Reviewed-on: #445
2024-04-26 09:59:09 +02:00

View File

@ -250,7 +250,13 @@ async fn create_kiosk(
} else if let Some(shipmaster) = data.shipmaster {
User::find_by_id(db, shipmaster as i32).await.unwrap()
} else {
User::find_by_id(db, data.rowers[0] as i32).await.unwrap()
let Some(rower) = data.rowers.get(0) else {
return Flash::error(
Redirect::to("/log"),
"Ausfahrt ohne Benutzer kann nicht angelegt werden.",
);
};
User::find_by_id(db, *rower as i32).await.unwrap()
};
Log::create(
db,