From a95445c53c96108a7cbcdf2001d7485044158515 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 9 Feb 2023 17:29:29 +0100 Subject: [PATCH] push --- README.md | 7 ------- db.sqlite | Bin 57344 -> 57344 bytes src/rest/restreg.rs | 8 ++++++-- 3 files changed, 6 insertions(+), 9 deletions(-) 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 c918d5fb4cacad8016e21f0070c42f32e4651eab..69e8f0e2e6ac5b53004b35b5d5589e96a4cb1d09 100644 GIT binary patch delta 886 zcmZ8fOH30{6rJhJlzHFVqF9p#p;CW|=uArs?Lr7f{6)jcA1;J|Qmv+tm{6w|9Dy#e0qRWJbe zpc7i)9GrjyumcJp4>CdKGkl7V@Il_gZ}3*$z-#$IUd995%U5t4`@uf2*X#+q&u+3S ztdT|7A-0nR**dn8DRh>8q;Kd`+DmWItMoiQNe|Oqw2-c+Su~=OpX3u6B}3!^xlOK- z3*;0zLUxlPvVp838vcc+@mu^1_u($whA-kMuE2Y62yetLY)5nGGa5tBQ4-xjadZit zMn}*1zcE`mo-w-__fb&5apbvJ}lDyL6x7^XD7BeABdNZ*U^Q+beJ2aND*7*hM6~OA zre%)?JraxvgJz%y28BVLR*dZw@6jBpN0!syHceGsLWt2T%Lv5=qGWOYMo8`MGyVW+ Cro=G- delta 4899 zcmeH}>u(fQ6u@WZ&ii$`tyr;^cG)T_EX>S4Tf_pTpdwO0B*vInr9dN5EN>8pi6Wvg z#jJ{g36aDHB8j*mD4>!MBcMots40|3qKQGQzz04+MLg58cF!N+x7}oOXMTJ3-ru=% z=iak=A6vbTt*?s2IF7UNTli$(7?I#(JDzyVdzVA{R*A9k00z}{tlXuoB@WG}Rzw5Qo)?N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.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("/"); }