From 1af3838ebc269684954fd82bbcfb09b83723f402 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 3 Apr 2024 08:13:32 +0200 Subject: [PATCH 1/2] use proper timezone --- templates/index.html.tera | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/index.html.tera b/templates/index.html.tera index debf756..c03d4d1 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -20,7 +20,7 @@
- {{ notification.category }} • {{ notification.created_at | date(format="%d.%m.%Y %H:%M") }} + {{ notification.category }} • {{ notification.created_at | date(timezone="Europe/Vienna", format="%d.%m.%Y %H:%M", ) }}
{{ notification.message }}
@@ -45,7 +45,7 @@ {% if notification.read_at %}
- {{ notification.category }} • {{ notification.created_at | date(format="%d.%m.%Y %H:%M") }} + {{ notification.category }} • {{ notification.created_at | date(timezone="Europe/Vienna", format="%d.%m.%Y %H:%M") }}
{{ notification.message }}
-- 2.45.2 From d0c2b4d703a67b4b73c3a34571af6df045d50de6 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 3 Apr 2024 18:07:20 +0200 Subject: [PATCH 2/2] don't show duplicate boats for rennrowing --- Cargo.lock | 1 + Cargo.toml | 1 + src/model/boat.rs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 8272604..bd1ab24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2204,6 +2204,7 @@ dependencies = [ "env_logger", "futures", "ics", + "itertools", "lettre", "log", "openssl", diff --git a/Cargo.toml b/Cargo.toml index 7cd7572..e2f87da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ ics = "0.5" futures = "0.3" lettre = "0.11" csv = "1.3" +itertools = "0.12" [target.'cfg(not(windows))'.dependencies] openssl = { version = "0.10", features = [ "vendored" ] } diff --git a/src/model/boat.rs b/src/model/boat.rs index 8db886c..71ce3ce 100644 --- a/src/model/boat.rs +++ b/src/model/boat.rs @@ -1,5 +1,6 @@ use std::ops::DerefMut; +use itertools::Itertools; use rocket::serde::{Deserialize, Serialize}; use rocket::FromForm; use sqlx::{FromRow, Sqlite, SqlitePool, Transaction}; @@ -7,7 +8,7 @@ use sqlx::{FromRow, Sqlite, SqlitePool, Transaction}; use super::location::Location; use super::user::User; -#[derive(FromRow, Debug, Serialize, Deserialize)] +#[derive(FromRow, Debug, Serialize, Deserialize, Eq, Hash, PartialEq, Clone)] pub struct Boat { pub id: i64, pub name: String, @@ -279,6 +280,7 @@ ORDER BY amount_seats DESC .unwrap(); //TODO: fixme boats.extend(boats_in_ottensheim.into_iter()); } + let boats = boats.into_iter().unique().collect(); Self::boats_to_details(db, boats).await } -- 2.45.2