call user.set_password() in PLUser.save() instead of PLUserAdmin.save()
diff --git a/plstackapi/core/admin.py b/plstackapi/core/admin.py
index 230dbfc..39838fa 100644
--- a/plstackapi/core/admin.py
+++ b/plstackapi/core/admin.py
@@ -280,7 +280,8 @@
def save(self, commit=True):
# Save the provided password in hashed format
user = super(UserCreationForm, self).save(commit=False)
- user.set_password(self.cleaned_data["password1"])
+ user.password = self.cleaned_data["password1"]
+ #user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
return user
diff --git a/plstackapi/core/models/pluser.py b/plstackapi/core/models/pluser.py
index 1c01a42..f914662 100644
--- a/plstackapi/core/models/pluser.py
+++ b/plstackapi/core/models/pluser.py
@@ -102,15 +102,16 @@
def save(self, *args, **kwds):
if not self.user_id:
- if not hasattr(self, 'driver'):
+ if not self.driver:
setattr(self, 'driver', OpenStackDriver())
name = self.email[:self.email.find('@')]
user_fields = {'name': name,
'email': self.email,
'password': self.password,
- 'enabled': self.is_active}
- user = self.driver.create_user(**user_fields)
- self.user_id = user.id
+ 'enabled': True}
+ keystone_user = self.driver.create_user(**user_fields)
+ self.user_id = keystone_user.id
+ self.set_password(self.password)
super(PLUser, self).save(*args, **kwds)
def delete(self, *args, **kwds):