allow openstack fields to contain null/blank values. separate User.is_admin from User.is_staff. expose User.is_admin on mdole admin form
diff --git a/plstackapi/core/models/pluser.py b/plstackapi/core/models/pluser.py
index b64f223..6688cfe 100644
--- a/plstackapi/core/models/pluser.py
+++ b/plstackapi/core/models/pluser.py
@@ -55,7 +55,7 @@
db_index=True,
)
- user_id = models.CharField(help_text="keystone user id", max_length=200)
+ user_id = models.CharField(null=True, blank=True, help_text="keystone user id", max_length=200)
firstname = models.CharField(help_text="person's given name", max_length=200)
lastname = models.CharField(help_text="person's surname", max_length=200)
@@ -64,7 +64,7 @@
site = models.ForeignKey(Site, related_name='users', verbose_name="Site this user will be homed too", null=True)
is_active = models.BooleanField(default=True)
- is_admin = models.BooleanField(default=True)
+ is_admin = models.BooleanField(default=False)
is_staff = models.BooleanField(default=True)
objects = PLUserManager()
@@ -93,13 +93,6 @@
# Simplest possible answer: Yes, always
return True
- @property
- def is_staff(self):
- "Is the user a member of staff?"
- # Simplest possible answer: All admins are staff
- return self.is_admin
-
-
def save(self, *args, **kwds):
if not hasattr(self, 'os_manager'):
setattr(self, 'os_manager', OpenStackManager())