forked from Ruderverein-Donau-Linz/rowt
push
This commit is contained in:
parent
432962f5a9
commit
a95445c53c
@ -1,10 +1,3 @@
|
|||||||
# Next
|
|
||||||
- User edit view (for admins)
|
|
||||||
- If is\_cox -> show 100(?) instead of 7 days
|
|
||||||
|
|
||||||
# UI
|
|
||||||
- Next 7 days as columns
|
|
||||||
|
|
||||||
# Edge case
|
# Edge case
|
||||||
- Trip in the morning on usi rowing day
|
- Trip in the morning on usi rowing day
|
||||||
- after N people (/ cox) -> red highlighted -> queue
|
- after N people (/ cox) -> red highlighted -> queue
|
||||||
|
@ -13,14 +13,18 @@ struct RegisterForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[put("/", data = "<register>")]
|
#[put("/", data = "<register>")]
|
||||||
async fn register(db: &State<DatabaseConnection>, register: Form<RegisterForm>) -> Redirect {
|
async fn register(
|
||||||
|
db: &State<DatabaseConnection>,
|
||||||
|
register: Form<RegisterForm>,
|
||||||
|
user: user::Model,
|
||||||
|
) -> Redirect {
|
||||||
let day = day::Entity::find_by_id(*register.day)
|
let day = day::Entity::find_by_id(*register.day)
|
||||||
.one(db.inner())
|
.one(db.inner())
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.expect("There's no trip on this date (yet)");
|
.expect("There's no trip on this date (yet)");
|
||||||
|
|
||||||
if !day.open_registration {
|
if !(day.open_registration || user.is_cox) {
|
||||||
return Redirect::to("/");
|
return Redirect::to("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user