Set xp by level only when incoming level is different from user level #281
This commit is contained in:
parent
ccf41bec79
commit
8025c31339
@ -39,6 +39,7 @@ class UserMutation(QueryABC):
|
|||||||
|
|
||||||
if "levelId" in input:
|
if "levelId" in input:
|
||||||
level = self._levels.get_level_by_id(input["levelId"])
|
level = self._levels.get_level_by_id(input["levelId"])
|
||||||
|
if user.level.id != level.id:
|
||||||
user.xp = level.min_xp
|
user.xp = level.min_xp
|
||||||
else:
|
else:
|
||||||
user.xp = input["xp"] if "xp" in input else user.xp
|
user.xp = input["xp"] if "xp" in input else user.xp
|
||||||
|
Loading…
Reference in New Issue
Block a user