mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 09:10:00 +00:00
Clean up models.User.level helpers
This commit is contained in:
parent
95d2bff614
commit
2ccf23a1f3
|
@ -382,15 +382,15 @@ class User(db.Model):
|
|||
|
||||
@property
|
||||
def is_admin(self):
|
||||
return self.level is UserLevelType.ADMIN or self.level is UserLevelType.SUPERADMIN
|
||||
return self.level >= UserLevelType.ADMIN
|
||||
|
||||
@property
|
||||
def is_superadmin(self):
|
||||
return self.level is UserLevelType.SUPERADMIN
|
||||
return self.level == UserLevelType.SUPERADMIN
|
||||
|
||||
@property
|
||||
def is_trusted(self):
|
||||
return self.level is UserLevelType.TRUSTED
|
||||
return self.level >= UserLevelType.TRUSTED
|
||||
|
||||
|
||||
# class Session(db.Model):
|
||||
|
|
Loading…
Reference in a new issue