Compare commits

...

3 Commits

Author SHA1 Message Date
31c62b4108 Added missing translations 2024-01-26 11:37:36 +01:00
b0990b626c Fixed third user warning 2024-01-26 11:36:42 +01:00
df9c889c7e Fixed add new user warning 2024-01-26 11:32:42 +01:00
4 changed files with 16 additions and 6 deletions

View File

@ -92,11 +92,8 @@ class UserWarningsService:
elif existing_warnings.count() == 3: elif existing_warnings.count() == 3:
server = self._servers.get_server_by_discord_id(member.guild.id) server = self._servers.get_server_by_discord_id(member.guild.id)
user = self._users.get_user_by_discord_id_and_server_id(member.id, server.id) user = self._users.get_user_by_discord_id_and_server_id(member.id, server.id)
levels = self._levels.get_levels_by_server_id(server.id)
new_level = levels.where(lambda l: l.min_xp > 0).order_by(lambda l: l.min_xp).last_or_default() user.xp = 0
if new_level is not None:
user.xp = new_level.min_xp
self._users.update_user(user) self._users.update_user(user)
self._db.save_changes() self._db.save_changes()
await self.notify_user(member, self._t.transform("modules.base.warnings.third")) await self.notify_user(member, self._t.transform("modules.base.warnings.third"))

View File

@ -183,6 +183,7 @@ export class UserWarningComponent extends ComponentWithTable implements OnInit,
} }
this.updateUserByWarning(newUserWarning.user?.id ?? 0, this.userWarnings.filter(uw => uw.user?.id == newUserWarning.user?.id)); this.updateUserByWarning(newUserWarning.user?.id ?? 0, this.userWarnings.filter(uw => uw.user?.id == newUserWarning.user?.id));
this.isEditingNew = false;
} }
public onRowEditCancel(index: number): void { public onRowEditCancel(index: number): void {

View File

@ -374,6 +374,12 @@
"save": "Speichern", "save": "Speichern",
"wrong_password": "Falsches Passwort" "wrong_password": "Falsches Passwort"
}, },
"change_password": {
"message": {
"error": "Fehler",
"password_cannot_be_changed": "Passwort konnte nicht geändert werden"
}
},
"dashboard": { "dashboard": {
"filter": { "filter": {
"name": "Name" "name": "Name"

View File

@ -374,6 +374,12 @@
"save": "Save", "save": "Save",
"wrong_password": "Wrong password" "wrong_password": "Wrong password"
}, },
"change_password": {
"message": {
"error": "Error",
"password_cannot_be_changed": "Password change failed"
}
},
"dashboard": { "dashboard": {
"filter": { "filter": {
"name": "Name" "name": "Name"