Merge pull request 'allow scheckbuch finances editing via /user/fees' (#1045) from consistent-user-management into staging
Reviewed-on: #1045
This commit was merged in pull request #1045.
	This commit is contained in:
		| @@ -1,9 +1,9 @@ | ||||
| use std::{error::Error, fs}; | ||||
|  | ||||
| use lettre::{ | ||||
|     Address, Message, SmtpTransport, Transport, | ||||
|     message::{Attachment, MultiPart, SinglePart, header::ContentType}, | ||||
|     message::{header::ContentType, Attachment, MultiPart, SinglePart}, | ||||
|     transport::smtp::authentication::Credentials, | ||||
|     Address, Message, SmtpTransport, Transport, | ||||
| }; | ||||
| use sqlx::{Sqlite, SqlitePool, Transaction}; | ||||
|  | ||||
| @@ -162,7 +162,7 @@ impl Mail { | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if user.has_role(db, "schnupperant").await { | ||||
|             if user.has_role(db, "schnupperant").await || user.has_role(db, "scheckbuch").await { | ||||
|                 continue; | ||||
|             } | ||||
|  | ||||
| @@ -279,7 +279,7 @@ Der Vorstand"); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if user.has_role(db, "schnupperant").await { | ||||
|             if user.has_role(db, "schnupperant").await || user.has_role(db, "scheckbuch").await { | ||||
|                 continue; | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| use super::User; | ||||
| use crate::{ | ||||
|     BOAT_STORAGE, DUAL_MEMBERSHIP, EINSCHREIBGEBUEHR, FAMILY_THREE_OR_MORE, FAMILY_TWO, FOERDERND, | ||||
|     REGULAR, RENNRUDERBEITRAG, STUDENT_OR_PUPIL, TRIAL_ROWING, TRIAL_ROWING_REDUCED, | ||||
|     UNTERSTUETZEND, model::family::Family, | ||||
|     model::family::Family, BOAT_STORAGE, DUAL_MEMBERSHIP, EINSCHREIBGEBUEHR, FAMILY_THREE_OR_MORE, | ||||
|     FAMILY_TWO, FOERDERND, REGULAR, RENNRUDERBEITRAG, SCHECKBUCH, STUDENT_OR_PUPIL, TRIAL_ROWING, | ||||
|     TRIAL_ROWING_REDUCED, UNTERSTUETZEND, | ||||
| }; | ||||
| use chrono::{Datelike, Local, NaiveDate}; | ||||
| use serde::Serialize; | ||||
| @@ -70,6 +70,7 @@ impl User { | ||||
|             && !self.has_role(db, "Unterstützend").await | ||||
|             && !self.has_role(db, "Förderndes Mitglied").await | ||||
|             && !self.has_role(db, "schnupperant").await | ||||
|             && !self.has_role(db, "scheckbuch").await | ||||
|         { | ||||
|             return None; | ||||
|         } | ||||
| @@ -110,6 +111,7 @@ impl User { | ||||
|             && !self.has_role(db, "Unterstützend").await | ||||
|             && !self.has_role(db, "Förderndes Mitglied").await | ||||
|             && !self.has_role(db, "schnupperant").await | ||||
|             && !self.has_role(db, "scheckbuch").await | ||||
|         { | ||||
|             return fee; | ||||
|         } | ||||
| @@ -162,6 +164,8 @@ impl User { | ||||
|             } else { | ||||
|                 fee.add("Schnupperkurs".into(), TRIAL_ROWING); | ||||
|             } | ||||
|         } else if self.has_role(db, "scheckbuch").await { | ||||
|             fee.add("Scheckbuch".into(), SCHECKBUCH); | ||||
|         } else if self.has_role(db, "Unterstützend").await { | ||||
|             fee.add("Unterstützendes Mitglied".into(), UNTERSTUETZEND); | ||||
|         } else if self.has_role(db, "Förderndes Mitglied").await { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user