From 591f9ea2456dbf0a00f77e06490402b9dca74c2e Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 20 Mar 2024 23:48:42 +0100 Subject: [PATCH] dont log pdf content --- src/model/user.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/model/user.rs b/src/model/user.rs index 5057f23..b3af652 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -26,7 +26,7 @@ const REGULAR: i32 = 22000; const UNTERSTUETZEND: i32 = 2500; const FOERDERND: i32 = 8500; -#[derive(FromRow, Debug, Serialize, Deserialize, Clone)] +#[derive(FromRow, Serialize, Deserialize, Clone)] pub struct User { pub id: i64, pub name: String, @@ -47,6 +47,29 @@ pub struct User { pub membership_pdf: Option>, } +impl fmt::Debug for User { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("User") + .field("id", &self.id) + .field("name", &self.name) + .field("dob", &self.dob) + .field("weight", &self.weight) + .field("sex", &self.sex) + .field("deleted", &self.deleted) + .field("last_access", &self.last_access) + .field("member_since_date", &self.member_since_date) + .field("birthdate", &self.birthdate) + .field("mail", &self.mail) + .field("nickname", &self.nickname) + .field("notes", &self.notes) + .field("phone", &self.phone) + .field("address", &self.address) + .field("family_id", &self.family_id) + // Note that membership_pdf is intentionally omitted here + .finish() + } +} + #[derive(Debug, Serialize, Deserialize)] pub struct UserWithRoles { #[serde(flatten)] -- 2.45.2