[open-ils-commits] r1124 - servres/trunk/conifer/syrup/views (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 27 20:07:54 EST 2010
Author: gfawcett
Date: 2010-12-27 20:07:53 -0500 (Mon, 27 Dec 2010)
New Revision: 1124
Modified:
servres/trunk/conifer/syrup/views/admin.py
Log:
make import-all-depts-and-courses code more tolerant of redundant course codes in the imported data.
Modified: servres/trunk/conifer/syrup/views/admin.py
===================================================================
--- servres/trunk/conifer/syrup/views/admin.py 2010-12-28 00:40:55 UTC (rev 1123)
+++ servres/trunk/conifer/syrup/views/admin.py 2010-12-28 01:07:53 UTC (rev 1124)
@@ -124,12 +124,13 @@
'hook %r not found.' % HOOKNAME)
else:
for deptname, ccode, cname in catalogue:
+ print (deptname, ccode, cname)
if not (deptname.strip() and ccode.strip() and cname.strip()):
continue
dept, x = models.Department.objects.get_or_create(
- name=deptname, service_desk=desk)
+ name=deptname, defaults={'service_desk': desk})
models.Course.objects.get_or_create(
- department=dept, name=cname, code=ccode)
+ code=ccode, defaults={'department': dept, 'name': cname})
return simple_message('Courses and departments updated.', '')
def admin_update_terms(request):
More information about the open-ils-commits
mailing list