1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 14:10:00 +00:00

Clean up models.User.level helpers

This commit is contained in:
TheAMM 2017-05-20 21:56:22 +03:00
parent 95d2bff614
commit 2ccf23a1f3

View file

@ -382,15 +382,15 @@ class User(db.Model):
@property @property
def is_admin(self): def is_admin(self):
return self.level is UserLevelType.ADMIN or self.level is UserLevelType.SUPERADMIN return self.level >= UserLevelType.ADMIN
@property @property
def is_superadmin(self): def is_superadmin(self):
return self.level is UserLevelType.SUPERADMIN return self.level == UserLevelType.SUPERADMIN
@property @property
def is_trusted(self): def is_trusted(self):
return self.level is UserLevelType.TRUSTED return self.level >= UserLevelType.TRUSTED
# class Session(db.Model): # class Session(db.Model):