Fixed negative xp check

This commit is contained in:
Sven Heidemann 2023-09-10 18:21:30 +02:00
parent 731f80bd5f
commit ed9b893c12

View File

@ -41,7 +41,7 @@ class LevelService:
def get_level(self, user: User) -> Level:
levels_by_server = self._levels.get_levels_by_server_id(user.server.id)
if user.xp < 0:
levels_by_server.order_by(lambda l: l.min_xp).first()
return levels_by_server.order_by(lambda l: l.min_xp).first()
levels = levels_by_server.order_by(lambda l: l.min_xp).where(lambda l: user.xp >= l.min_xp)