add is_admin method

This commit is contained in:
virusdefender 2017-02-10 14:37:52 +08:00
parent 817e5aadae
commit 29aa457a2d

View File

@ -51,6 +51,9 @@ class User(AbstractBaseUser):
objects = UserManager()
def is_admin(self):
return self.admin_type == AdminType.ADMIN
def is_super_admin(self):
return self.admin_type == AdminType.SUPER_ADMIN