use formatted_names in roles #1033
| @@ -40,7 +40,11 @@ impl Ord for Role { | ||||
|  | ||||
| impl Display for Role { | ||||
|     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||||
|         write!(f, "{}", self.name) | ||||
|         if let Some(formatted_name) = &self.formatted_name { | ||||
|             write!(f, "{}", formatted_name) | ||||
|         } else { | ||||
|             write!(f, "{}", self.name) | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -377,14 +377,14 @@ impl User { | ||||
|  | ||||
|         if let Some(old_financial) = self.financial(db).await { | ||||
|             self.remove_role(db, updated_by, &old_financial).await?; | ||||
|             old.push_str(&old_financial.name); | ||||
|             old.push_str(&old_financial.to_string()); | ||||
|         } else { | ||||
|             old.push_str("Keine Ermäßigung"); | ||||
|         } | ||||
|  | ||||
|         if let Some(new_financial) = financial { | ||||
|             self.add_role(db, updated_by, &new_financial).await?; | ||||
|             new.push_str(&new_financial.name); | ||||
|             new.push_str(&new_financial.to_string()); | ||||
|         } else { | ||||
|             new.push_str("Keine Ermäßigung"); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user