Ignore:
Timestamp:
29 May 2011, 09:23:30 (13 years ago)
Author:
Henrik Bettermann
Message:

Course codes must be unique. Check catalog when courses are added. Flash the place where course exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6210 r6216  
    13031303        course = createObject(u'waeup.Course')
    13041304        self.applyData(course, **data)
    1305         try:
    1306             self.context.courses.addCourse(course)
    1307         except KeyError:
    1308             self.status = Invalid('The code chosen already exists '
    1309                                   'in the database')
    1310             return
    1311         except DuplicationError:
    1312             self.status = Invalid('The code chosen already exists '
    1313                                   'in the database')
    1314             return
     1305        message = self.context.courses.addCourse(course)
     1306        self.flash(message)
    13151307        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
    13161308
Note: See TracChangeset for help on using the changeset viewer.