From 29aa457a2d27d1385bc77641477b168eed33fbd4 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Fri, 10 Feb 2017 14:37:52 +0800 Subject: [PATCH] add is_admin method --- account/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account/models.py b/account/models.py index 807df44..0e53c36 100644 --- a/account/models.py +++ b/account/models.py @@ -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