Ignore:
Timestamp:
2 Aug 2016, 14:45:49 (8 years ago)
Author:
Henrik Bettermann
Message:

Catch traceback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/reports/raw_score_report.py

    r14041 r14042  
    117117            'Matric No.',
    118118            'Name',
    119             #TTR('xxx'),
    120119            )
     120    catalog = getUtility(ICatalog, name='courses_catalog')
    121121    for code in course_codes:
    122         col_names += (TTR(code),)
     122        course = list(catalog.searchResults(code=(code, code)))[0]
     123        col_names += (TTR('%s (%s)' % (course.title, code)),)
    123124    table = [col_names]
    124125    sn = 1
     126    scores = tuple()
    125127    for line in data:
    126128        composed_line = (sn,) + line[:-1]
    127         scores = tuple([
    128             '%s%s' % (line[-1][code][0],line[-1][code][1])
    129             for code in course_codes])
     129        for code in course_codes:
     130            result = line[-1].get(code)
     131            if not result:
     132                continue
     133            scores += ('%s%s' % (result[0], result[1]),)
    130134        composed_line += scores
    131135        table.append(composed_line)
Note: See TracChangeset for help on using the changeset viewer.