Compare commits
2 Commits
de9e4aab9a
...
3a7cc0e3be
Author | SHA1 | Date | |
---|---|---|---|
3a7cc0e3be | |||
3b9c76417d |
@@ -253,6 +253,10 @@ DROP TABLE temp_pos;",
|
||||
return None;
|
||||
}
|
||||
|
||||
if self.stations(db).await.len() <= 1 {
|
||||
return None;
|
||||
}
|
||||
|
||||
let ret = sqlx::query_as::<_, Station>(
|
||||
"
|
||||
WITH RECURSIVE find_previous AS (
|
||||
@@ -296,8 +300,6 @@ LIMIT 1;
|
||||
.bind(self.id)
|
||||
.bind(self.id)
|
||||
.bind(self.id)
|
||||
.bind(self.id)
|
||||
.bind(station.id)
|
||||
.fetch_optional(db)
|
||||
.await
|
||||
.unwrap();
|
||||
|
@@ -15,13 +15,13 @@ pub(crate) mod print;
|
||||
mod typst;
|
||||
mod web;
|
||||
|
||||
#[derive(FromRow, Debug, Serialize, Deserialize)]
|
||||
#[derive(FromRow, Debug, Serialize, Deserialize, Clone)]
|
||||
pub(crate) struct Station {
|
||||
pub(crate) id: i64,
|
||||
pub(crate) name: String,
|
||||
notes: Option<String>,
|
||||
pub(crate) amount_people: Option<i64>,
|
||||
last_login: Option<NaiveDateTime>, // TODO use proper timestamp (NaiveDateTime?)
|
||||
last_login: Option<NaiveDateTime>,
|
||||
pub(crate) pw: String,
|
||||
pub(crate) ready: bool,
|
||||
pub(crate) lat: Option<f64>,
|
||||
|
@@ -312,7 +312,7 @@ impl Team {
|
||||
.await
|
||||
.next_station(db, &station)
|
||||
.await
|
||||
.unwrap();
|
||||
.unwrap_or(station.clone());
|
||||
if Rating::find_by_team_and_station(db, self, &next_station)
|
||||
.await
|
||||
.is_some()
|
||||
|
@@ -1,13 +1,13 @@
|
||||
use crate::{AppState, er, page, suc};
|
||||
use crate::{er, page, suc, AppState};
|
||||
use async_trait::async_trait;
|
||||
use axum::{
|
||||
Form, Router,
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Redirect},
|
||||
routing::{get, post},
|
||||
Form, Router,
|
||||
};
|
||||
use axum_login::{AuthUser, AuthnBackend};
|
||||
use maud::{Markup, html};
|
||||
use maud::{html, Markup};
|
||||
use password_auth::verify_password;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{FromRow, SqlitePool};
|
||||
@@ -119,8 +119,6 @@ async fn login(session: Session) -> Markup {
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: generate okayish looking login page
|
||||
|
||||
page(content, session, false).await
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user