1.0.3 #285 #286

Merged
edraft merged 5 commits from 1.0.3 into master 2023-03-30 16:55:32 +02:00
Showing only changes of commit 27363522d3 - Show all commits

View File

@ -37,12 +37,13 @@ class UserMutation(QueryABC):
user = self._users.get_user_by_id(input["id"])
self._can_user_mutate_data(user.server, UserRoleEnum.moderator)
new_xp = None
if "levelId" in input:
level = self._levels.get_level_by_id(input["levelId"])
if user.level.id != level.id:
user.xp = level.min_xp
else:
user.xp = input["xp"] if "xp" in input else user.xp
new_xp = level.min_xp
user.xp = new_xp if new_xp is not None else input["xp"] if "xp" in input else user.xp
self._users.update_user(user)
self._db.save_changes()