allow to change from 'bootsfuehrer' to 'cox' #1090
@ -342,12 +342,33 @@ impl User {
|
|||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
ActivityBuilder::new(&format!("{updated_by} hat {self} zum normalen Mitglied gemacht (keine Steuerperson/Schiffsführer mehr)"))
|
ActivityBuilder::new(&format!("{updated_by} hat {self} zum normalen Mitglied gemacht (keine Steuerperson/Bootsführer mehr)"))
|
||||||
.user(self)
|
.user(self)
|
||||||
.save(db)
|
.save(db)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
(old, new) if old == Some(bootsfuehrer.clone()) && new == Some(cox.clone()) => {
|
||||||
|
self.remove_role(db, updated_by, &bootsfuehrer).await?;
|
||||||
|
self.add_role(db, updated_by, &cox).await?;
|
||||||
|
Notification::create_for_role(
|
||||||
|
db,
|
||||||
|
&member,
|
||||||
|
&format!(
|
||||||
|
"Lieber Vorstand, {self} ist ab sofort kein Bootsführer:in mehr, sondern 'nur' mehr eine Steuerperson."
|
||||||
|
),
|
||||||
|
"Bootsführer--",
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
ActivityBuilder::new(&format!(
|
||||||
|
"{updated_by} hat {self} zur Steuerperson gemacht (kein Bootsführer mehr)"
|
||||||
|
))
|
||||||
|
.user(self)
|
||||||
|
.save(db)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
(old, new) => return Err(format!("Not allowed to change from {old:?} to {new:?}")),
|
(old, new) => return Err(format!("Not allowed to change from {old:?} to {new:?}")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user