Skip to content

Commit 30f7512

Browse files
Comanage_person_schema_utils.py : fix mutable default argument of co_person_org_id
1 parent fccb47b commit 30f7512

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

comanage_person_schema_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
import copy
23

34
CO_PERSON = {
45
"co_id": None,
@@ -167,16 +168,16 @@ def co_person_group_member(group_id, member=True, owner=False):
167168

168169

169170
def co_person_org_id(
170-
osg_co_id, name, organization="", department="", title="", affiliation="member", id_list=[]
171+
osg_co_id, name, organization="", department="", title="", affiliation="member", id_list=None
171172
):
172173
#org_id = {"co_id" : osg_co_id}
173-
org_id = ORG_IDENTITY.copy()
174+
org_id = copy.deepcopy(ORG_IDENTITY)
174175
org_id["co_id"] = osg_co_id
175176
org_id["title"] = title
176177
org_id["o"] = organization
177178
org_id["ou"] = department
178179
org_id["affiliation"] = affiliation
179-
org_id["Identifier"] = id_list
180+
org_id["Identifier"] = [] if id_list is None else id_list
180181
org_id["Name"] = name
181182
return org_id
182183

0 commit comments

Comments
 (0)