Skip to content

Commit

Permalink
add teachers delegations implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nurbal committed Feb 23, 2024
1 parent e7f3393 commit 2418574
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sarc/ldap/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sarc.ldap.mymila
from sarc.config import config
from sarc.ldap.mymila import fetch_mymila
from sarc.ldap.read_mila_ldap import fetch_ldap
from sarc.ldap.read_mila_ldap import fetch_ldap, load_ldap_exceptions
from sarc.ldap.revision import commit_matches_to_database


Expand Down Expand Up @@ -77,7 +77,13 @@ def run(prompt=False):
# "drac_members": {...} or None
# }

exceptions = load_ldap_exceptions(cfg.ldap)

for _, user in DD_persons_matched.items():
if user["mila_ldap"]["mila_email_username"] in exceptions["delegations"]:
user["teacher_delegations"] = exceptions["delegations"][
user["mila_ldap"]["mila_email_username"]
]
fill_computed_fields(user)

# These associations can now be propagated to the database.
Expand Down
1 change: 1 addition & 0 deletions sarc/ldap/revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def user_insert(newuser: dict) -> list:
"mila",
"drac_roles",
"drac_members",
"teacher_delegations",
)

update = {
Expand Down

0 comments on commit 2418574

Please sign in to comment.