Changeset 6245 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 30 May 2011, 07:41:18 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r6229 r6245 337 337 >>> print browser.contents 338 338 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 339 ...<li class="message"> Course exists already in...</li>339 ...<li class="message">A course with same code already exists:...</li> 340 340 ... 341 341 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6243 r6245 1292 1292 course = createObject(u'waeup.Course') 1293 1293 self.applyData(course, **data) 1294 message = self.context.courses.addCourse(course) 1294 try: 1295 self.context.courses.addCourse(course) 1296 except DuplicationError, error: 1297 # signals duplication error 1298 entries = error.entries 1299 for entry in entries: 1300 # do not use error.msg but render a more detailed message instead 1301 # and show links to all certs with same code 1302 message = 'A course with same code already exists: ' 1303 message += '<a href="%s">%s</a>' % ( 1304 self.url(entry), getattr(entry, '__name__', u'Unnamed')) 1305 self.flash(message) 1306 self.redirect(self.url(self.context, u'@@addcourse')) 1307 return 1308 message = u'Course %s successfully created.' % (course.code) 1295 1309 self.flash(message) 1296 1310 self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
Note: See TracChangeset for help on using the changeset viewer.