Skip to content

Commit

Permalink
Make people status independent of CO status
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvanes committed Jan 15, 2024
1 parent 071abb3 commit 878fcfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions plsc_flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def create(src, dst):
src_dn = src.rfind(f"o={co_id},dc=ordered,dc={service}", '(ObjectClass=organization)')
src_co = src_dn.get(f"o={co_id},dc=ordered,dc={service},{src.basedn}", {})
src_mail = src_co.get('mail', [])
src_status = src_co.get('organizationalStatus', ['active'])
logging.debug(f"src_mail: {src_mail}")

co_dn = f"dc=flat,dc={service},{dst.basedn}"
Expand Down Expand Up @@ -106,6 +107,7 @@ def create(src, dst):
new_entry['cn'] = [grp_cn]
new_entry['member'] = members
new_entry['mail'] = src_mail
new_entry['organizationalStatus'] = src_status

dst_dn = f"cn={grp_cn},ou=Groups,{co_dn}"

Expand Down
1 change: 1 addition & 0 deletions plsc_ordered.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def create(src, dst):
co_entry['businessCategory'] = add_scope(values=co.get('tags'),
scope=co['organisation']['short_name'])
co_entry['mail'] = list(set(admin.get('email') for admin in co.get('admins')))
co_entry['OrganizationalStatus'] = [co.get('status', 'active')]

co_dns = dst.rfind(f"dc=ordered,dc={service}", f"(&(objectClass=organization)(o={co_identifier}))")

Expand Down
6 changes: 1 addition & 5 deletions sbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ def service_collaborations(self):

c['admins'] = []
for m in c.get('collaboration_memberships', []):
status = c.get('status', 'active')
if status == 'active':
status = m['status']

m['user'] = {**users[m['user_id']], **{'status': status}}
m['user'] = {**users[m['user_id']], **{'status': m.get('status', None)}}
if m['role'] == 'admin':
c['admins'].append(m['user'])

Expand Down

0 comments on commit 878fcfa

Please sign in to comment.