mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't try to add the default group to a user when creating the group.
This is done automatically and trying to do so will return an error. 432106
This commit is contained in:
parent
58cfc7ab68
commit
4b4a13c201
@ -282,11 +282,26 @@ class UserController(IPAController):
|
||||
try:
|
||||
dnadds = kw.get('dnadd')
|
||||
cherrypy.session['uid'] = user_dict.get('uid')
|
||||
|
||||
# remove the default group from failed add
|
||||
if dnadds != None:
|
||||
if not(isinstance(dnadds,list) or isinstance(dnadds,tuple)):
|
||||
dnadds = [dnadds]
|
||||
failed_adds = client.add_groups_to_user(
|
||||
utf8_encode_values(dnadds), user.dn)
|
||||
try:
|
||||
conf=client.get_ipa_config()
|
||||
default_cn="cn=%s" % conf.getValue('ipadefaultprimarygroup')
|
||||
|
||||
if not(isinstance(dnadds,list) or isinstance(dnadds,tuple)):
|
||||
dnadds = [dnadds]
|
||||
|
||||
for d in dnadds:
|
||||
e = d.find(default_cn)
|
||||
if e >= 0:
|
||||
dnadds.remove(d)
|
||||
except:
|
||||
pass
|
||||
|
||||
if len(dnadds) > 0:
|
||||
failed_adds = client.add_groups_to_user(
|
||||
utf8_encode_values(dnadds), user.dn)
|
||||
kw['dnadd'] = failed_adds
|
||||
except ipaerror.IPAError, e:
|
||||
failed_adds = dnadds
|
||||
|
Loading…
Reference in New Issue
Block a user