fix small group handling bugs

- use create_grouptaskresult instead of create for creating
  GroupTaskResult
- use group.gid instead of non-existing group.id
This commit is contained in:
Jan Dittberner 2014-06-01 00:32:06 +02:00
parent d1abe10349
commit e8285518a3

View file

@ -174,7 +174,7 @@ class UserManager(models.Manager):
password = generate_password() password = generate_password()
homedir = os.path.join(settings.OSUSER_HOME_BASEPATH, username) homedir = os.path.join(settings.OSUSER_HOME_BASEPATH, username)
group = Group.objects.create(groupname=username, gid=gid) group = Group.objects.create(groupname=username, gid=gid)
GroupTaskResult.objects.create( GroupTaskResult.objects.create_grouptaskresult(
group, group,
create_ldap_group.delay(group.groupname, group.gid, group.descr) create_ldap_group.delay(group.groupname, group.gid, group.descr)
) )
@ -212,7 +212,7 @@ class User(TimeStampedModel, models.Model):
UserTaskResult.objects.create_usertaskresult( UserTaskResult.objects.create_usertaskresult(
self, self,
create_ldap_user.delay( create_ldap_user.delay(
self.username, self.uid, self.group.id, self.gecos, self.username, self.uid, self.group.gid, self.gecos,
self.homedir, self.shell, password self.homedir, self.shell, password
), ),
commit=True commit=True
@ -222,7 +222,7 @@ class User(TimeStampedModel, models.Model):
UserTaskResult.objects.create_usertaskresult( UserTaskResult.objects.create_usertaskresult(
self, self,
create_ldap_user.delay( create_ldap_user.delay(
self.username, self.uid, self.group.id, self.gecos, self.username, self.uid, self.group.gid, self.gecos,
self.homedir, self.shell, password=None self.homedir, self.shell, password=None
) )
) )