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:
parent
d1abe10349
commit
e8285518a3
1 changed files with 3 additions and 3 deletions
|
@ -174,7 +174,7 @@ class UserManager(models.Manager):
|
|||
password = generate_password()
|
||||
homedir = os.path.join(settings.OSUSER_HOME_BASEPATH, username)
|
||||
group = Group.objects.create(groupname=username, gid=gid)
|
||||
GroupTaskResult.objects.create(
|
||||
GroupTaskResult.objects.create_grouptaskresult(
|
||||
group,
|
||||
create_ldap_group.delay(group.groupname, group.gid, group.descr)
|
||||
)
|
||||
|
@ -212,7 +212,7 @@ class User(TimeStampedModel, models.Model):
|
|||
UserTaskResult.objects.create_usertaskresult(
|
||||
self,
|
||||
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
|
||||
),
|
||||
commit=True
|
||||
|
@ -222,7 +222,7 @@ class User(TimeStampedModel, models.Model):
|
|||
UserTaskResult.objects.create_usertaskresult(
|
||||
self,
|
||||
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
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue