allow scheckbuch finances editing via /user/fees #1045
@ -1,9 +1,9 @@
|
|||||||
use std::{error::Error, fs};
|
use std::{error::Error, fs};
|
||||||
|
|
||||||
use lettre::{
|
use lettre::{
|
||||||
Address, Message, SmtpTransport, Transport,
|
message::{header::ContentType, Attachment, MultiPart, SinglePart},
|
||||||
message::{Attachment, MultiPart, SinglePart, header::ContentType},
|
|
||||||
transport::smtp::authentication::Credentials,
|
transport::smtp::authentication::Credentials,
|
||||||
|
Address, Message, SmtpTransport, Transport,
|
||||||
};
|
};
|
||||||
use sqlx::{Sqlite, SqlitePool, Transaction};
|
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;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use super::User;
|
use super::User;
|
||||||
use crate::{
|
use crate::{
|
||||||
BOAT_STORAGE, DUAL_MEMBERSHIP, EINSCHREIBGEBUEHR, FAMILY_THREE_OR_MORE, FAMILY_TWO, FOERDERND,
|
model::family::Family, BOAT_STORAGE, DUAL_MEMBERSHIP, EINSCHREIBGEBUEHR, FAMILY_THREE_OR_MORE,
|
||||||
REGULAR, RENNRUDERBEITRAG, STUDENT_OR_PUPIL, TRIAL_ROWING, TRIAL_ROWING_REDUCED,
|
FAMILY_TWO, FOERDERND, REGULAR, RENNRUDERBEITRAG, SCHECKBUCH, STUDENT_OR_PUPIL, TRIAL_ROWING,
|
||||||
UNTERSTUETZEND, model::family::Family,
|
TRIAL_ROWING_REDUCED, UNTERSTUETZEND,
|
||||||
};
|
};
|
||||||
use chrono::{Datelike, Local, NaiveDate};
|
use chrono::{Datelike, Local, NaiveDate};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
@ -70,6 +70,7 @@ impl User {
|
|||||||
&& !self.has_role(db, "Unterstützend").await
|
&& !self.has_role(db, "Unterstützend").await
|
||||||
&& !self.has_role(db, "Förderndes Mitglied").await
|
&& !self.has_role(db, "Förderndes Mitglied").await
|
||||||
&& !self.has_role(db, "schnupperant").await
|
&& !self.has_role(db, "schnupperant").await
|
||||||
|
&& !self.has_role(db, "scheckbuch").await
|
||||||
{
|
{
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -110,6 +111,7 @@ impl User {
|
|||||||
&& !self.has_role(db, "Unterstützend").await
|
&& !self.has_role(db, "Unterstützend").await
|
||||||
&& !self.has_role(db, "Förderndes Mitglied").await
|
&& !self.has_role(db, "Förderndes Mitglied").await
|
||||||
&& !self.has_role(db, "schnupperant").await
|
&& !self.has_role(db, "schnupperant").await
|
||||||
|
&& !self.has_role(db, "scheckbuch").await
|
||||||
{
|
{
|
||||||
return fee;
|
return fee;
|
||||||
}
|
}
|
||||||
@ -162,6 +164,8 @@ impl User {
|
|||||||
} else {
|
} else {
|
||||||
fee.add("Schnupperkurs".into(), TRIAL_ROWING);
|
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 {
|
} else if self.has_role(db, "Unterstützend").await {
|
||||||
fee.add("Unterstützendes Mitglied".into(), UNTERSTUETZEND);
|
fee.add("Unterstützendes Mitglied".into(), UNTERSTUETZEND);
|
||||||
} else if self.has_role(db, "Förderndes Mitglied").await {
|
} else if self.has_role(db, "Förderndes Mitglied").await {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user