Bug fix: build_gecos() did not include enough commas between fields.
This commit is contained in:
parent
c5c59197e6
commit
8815949899
|
@ -891,14 +891,18 @@ def build_gecos(fullname=None, roomnumber=None, workphone=None, homephone=None,
|
||||||
if other and ':' in str(other):
|
if other and ':' in str(other):
|
||||||
raise InvalidArgument('other', other, "invalid characters")
|
raise InvalidArgument('other', other, "invalid characters")
|
||||||
|
|
||||||
# append each field
|
# join the fields
|
||||||
if fullname is not None:
|
if fullname is not None:
|
||||||
gecos_data = str(fullname)
|
gecos_data = str(fullname)
|
||||||
for field in (roomnumber, workphone, homephone, other):
|
fields = [ fullname, roomnumber, workphone, homephone, other ]
|
||||||
if field is not None:
|
for idx in xrange(len(fields), 0, -1):
|
||||||
gecos_data += ',' + str(field)
|
if not fields[idx-1]:
|
||||||
|
fields.pop()
|
||||||
return gecos_data
|
else:
|
||||||
|
break
|
||||||
|
while None in fields:
|
||||||
|
fields[fields.index(None)] = ''
|
||||||
|
return ','.join(map(str, fields))
|
||||||
|
|
||||||
|
|
||||||
def check_id_nss(ugid):
|
def check_id_nss(ugid):
|
||||||
|
|
Loading…
Reference in New Issue