diff --git a/README.md b/README.md index 8a2315c..72c026b 100644 --- a/README.md +++ b/README.md @@ -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 - Trip in the morning on usi rowing day - after N people (/ cox) -> red highlighted -> queue diff --git a/db.sqlite b/db.sqlite index c918d5f..69e8f0e 100644 Binary files a/db.sqlite and b/db.sqlite differ diff --git a/src/rest/restreg.rs b/src/rest/restreg.rs index 9dd4414..434c23d 100644 --- a/src/rest/restreg.rs +++ b/src/rest/restreg.rs @@ -13,14 +13,18 @@ struct RegisterForm { } #[put("/", data = "")] -async fn register(db: &State, register: Form) -> Redirect { +async fn register( + db: &State, + register: Form, + user: user::Model, +) -> Redirect { let day = day::Entity::find_by_id(*register.day) .one(db.inner()) .await .unwrap() .expect("There's no trip on this date (yet)"); - if !day.open_registration { + if !(day.open_registration || user.is_cox) { return Redirect::to("/"); }