1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +00:00

Fixed bug in sys useradmin

This commit is contained in:
zhengxie
2013-03-09 20:43:22 +08:00
parent df5d7d22ec
commit 6e30e60373
3 changed files with 13 additions and 8 deletions

View File

@@ -96,9 +96,14 @@ class User(object):
def save(self):
emailuser = ccnet_threaded_rpc.get_emailuser(self.username)
if emailuser:
ccnet_threaded_rpc.update_emailuser(emailuser.id, self.password,
int(self.is_staff),
int(self.is_active))
if hasattr(self, 'password'): # setted by set_password()
ccnet_threaded_rpc.update_emailuser(emailuser.id,
self.password,
int(self.is_staff),
int(self.is_active))
else:
# TODO: need a new rpc tp update is_staff and is_active
raise NotImplementedError
else:
ccnet_threaded_rpc.add_emailuser(self.username, self.password,
int(self.is_staff),