[open-ils-commits] r159 - in servres/trunk/conifer: syrup templates (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 9 19:49:25 EDT 2009
Author: gfawcett
Date: 2009-03-09 19:49:24 -0400 (Mon, 09 Mar 2009)
New Revision: 159
Modified:
servres/trunk/conifer/syrup/models.py
servres/trunk/conifer/templates/edit_course_permissions.xhtml
Log:
constrain Member class: (course,user) must be unique.
Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py 2009-03-09 23:13:55 UTC (rev 158)
+++ servres/trunk/conifer/syrup/models.py 2009-03-09 23:49:24 UTC (rev 159)
@@ -291,6 +291,9 @@
return course_sections.sections_tuple_delimiter.join(section).encode('base64').strip()
class Member(m.Model):
+ class Meta:
+ unique_together = (('course', 'user'))
+
course = m.ForeignKey(Course)
user = m.ForeignKey(User)
role = m.CharField(
Modified: servres/trunk/conifer/templates/edit_course_permissions.xhtml
===================================================================
--- servres/trunk/conifer/templates/edit_course_permissions.xhtml 2009-03-09 23:13:55 UTC (rev 158)
+++ servres/trunk/conifer/templates/edit_course_permissions.xhtml 2009-03-09 23:49:24 UTC (rev 159)
@@ -28,7 +28,7 @@
[(u'INSTR',_(u'Instructor')), (u'PROXY', _(u'Proxy instructor'))])
.render('instructor_role_%d' % mbr.id, mbr.role))"/>
<tr py:for="mbr in instructors">
- <td>${mbr.user.get_full_name() or mbr.user}</td>
+ <td>${mbr.user.get_full_name() or ''} <code>(${mbr.user.username})</code></td>
<td>${select_role(mbr)}</td>
<td><input type="checkbox" name="instructor_remove_${mbr.id}"/></td>
</tr>
More information about the open-ils-commits
mailing list