[open-ils-commits] r1180 - servres/trunk/conifer/uwindsor_migration (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jan 9 23:13:32 EST 2011
Author: gfawcett
Date: 2011-01-09 23:13:30 -0500 (Sun, 09 Jan 2011)
New Revision: 1180
Modified:
servres/trunk/conifer/uwindsor_migration/physicals-extract.py
Log:
add extra instructors to site.
Modified: servres/trunk/conifer/uwindsor_migration/physicals-extract.py
===================================================================
--- servres/trunk/conifer/uwindsor_migration/physicals-extract.py 2011-01-10 04:01:01 UTC (rev 1179)
+++ servres/trunk/conifer/uwindsor_migration/physicals-extract.py 2011-01-10 04:13:30 UTC (rev 1180)
@@ -94,6 +94,7 @@
else:
# this one we can actually use!
print ('OK', code, title, profs, url)
+ persons = sorted(list(persons), key=lambda p: p.sn)
sections = []
for prof in persons:
for sec in prof.uwinCourseTeach:
@@ -104,6 +105,10 @@
# set up the access control lists
for uid, sec in sections:
Group.objects.get_or_create(site=site, external_id=sec)
+ group = site.group_set.get(external_id__isnull=True)
+ for uid in [p.uid for p in persons][1:]:
+ Membership.objects.get_or_create(group=group, user=ensure_user(uid),
+ role='INSTR')
# let's lookup the items.
site.item_set.filter(item_type='PHYS').delete()
@@ -115,3 +120,4 @@
count+=1
# if count > 5:
# break
+
More information about the open-ils-commits
mailing list