1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

Add create_superuser method and update tests

This commit is contained in:
xiez
2012-08-19 16:47:02 +08:00
parent a88af0b3a8
commit 12da94589d
2 changed files with 23 additions and 12 deletions

View File

@@ -35,6 +35,10 @@ class UserManager(object):
return self.get(email=email)
def create_superuser(self, email, password):
u = self.create_user(email, password, is_staff=True, is_active=True)
return u
def get(self, email=None, id=None):
if not email and not id:
raise User.DoesNotExist, 'User matching query does not exits.'