forked from Ruderverein-Donau-Linz/rowt
fix ci
This commit is contained in:
parent
dc3e5555df
commit
e1a7bdae65
BIN
db.sqlite.bkp
BIN
db.sqlite.bkp
Binary file not shown.
@ -7,7 +7,12 @@ CREATE TABLE IF NOT EXISTS "user" (
|
|||||||
"is_guest" boolean NOT NULL DEFAULT TRUE,
|
"is_guest" boolean NOT NULL DEFAULT TRUE,
|
||||||
"is_tech" boolean NOT NULL DEFAULT FALSE,
|
"is_tech" boolean NOT NULL DEFAULT FALSE,
|
||||||
"deleted" boolean NOT NULL DEFAULT FALSE,
|
"deleted" boolean NOT NULL DEFAULT FALSE,
|
||||||
"last_access" DATETIME
|
"last_access" DATETIME,
|
||||||
|
"dob" text,
|
||||||
|
"weight" text,
|
||||||
|
"sex" text,
|
||||||
|
"dirty_thirty" text,
|
||||||
|
"dirty_dozen" text
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "trip_type" (
|
CREATE TABLE IF NOT EXISTS "trip_type" (
|
||||||
@ -115,10 +120,3 @@ CREATE TABLE IF NOT EXISTS "boat_damage" (
|
|||||||
"verified_at" datetime,
|
"verified_at" datetime,
|
||||||
"lock_boat" boolean not null default false -- if true: noone can use the boat
|
"lock_boat" boolean not null default false -- if true: noone can use the boat
|
||||||
);
|
);
|
||||||
|
|
||||||
-- tmp ergo challenge stuff
|
|
||||||
ALTER TABLE user ADD COLUMN dob text;
|
|
||||||
ALTER TABLE user ADD COLUMN weight text;
|
|
||||||
ALTER TABLE user ADD COLUMN sex text;
|
|
||||||
ALTER TABLE user ADD COLUMN dirty_thirty text;
|
|
||||||
ALTER TABLE user ADD COLUMN dirty_dozen text;
|
|
||||||
|
@ -389,7 +389,7 @@ ORDER BY departure DESC
|
|||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.id
|
.id
|
||||||
.unwrap()
|
.unwrap() as i32
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn home(
|
pub async fn home(
|
||||||
|
@ -530,7 +530,7 @@ impl<'r> FromRequest<'r> for NonGuestUser {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::testdb;
|
use crate::{tera::admin::user::UserEditForm, testdb};
|
||||||
|
|
||||||
use super::User;
|
use super::User;
|
||||||
use sqlx::SqlitePool;
|
use sqlx::SqlitePool;
|
||||||
@ -599,7 +599,20 @@ mod test {
|
|||||||
let pool = testdb!();
|
let pool = testdb!();
|
||||||
|
|
||||||
let user = User::find_by_id(&pool, 1).await.unwrap();
|
let user = User::find_by_id(&pool, 1).await.unwrap();
|
||||||
user.update(&pool, false, false, false, false).await;
|
user.update(
|
||||||
|
&pool,
|
||||||
|
UserEditForm {
|
||||||
|
id: 1,
|
||||||
|
is_guest: false,
|
||||||
|
is_cox: false,
|
||||||
|
is_admin: false,
|
||||||
|
is_tech: false,
|
||||||
|
dob: None,
|
||||||
|
weight: None,
|
||||||
|
sex: None,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
let user = User::find_by_id(&pool, 1).await.unwrap();
|
let user = User::find_by_id(&pool, 1).await.unwrap();
|
||||||
assert_eq!(user.is_admin, false);
|
assert_eq!(user.is_admin, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user