Added check with -xp to get_level #357
@ -40,6 +40,9 @@ 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:
|
||||
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)
|
||||
|
||||
if levels.count() == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user
Ich meine hier fehlt ein Return.
Dem ist auch so