Changeset 15662


Ignore:
Timestamp:
11 Oct 2019, 14:36:17 (5 years ago)
Author:
Henrik Bettermann
Message:

Catch LookupError?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r15652 r15662  
    186186            f_label = Paragraph(f_label, ENTRY1_STYLE)
    187187            entry_session = studentview.context.entry_session
    188             entry_session = academic_sessions_vocab.getTerm(entry_session).title
     188            try:
     189                entry_session = academic_sessions_vocab.getTerm(
     190                    entry_session).title
     191            except LookupError:
     192                entry_session = _('void')
    189193            f_text = formatted_text(entry_session)
    190194            f_text = Paragraph(f_text, ENTRY1_STYLE)
     
    10121016        filename = '%s_%s_%s_%s.pdf' % (
    10131017            name, view.context.code, session, view.request.principal.id)
    1014         session = academic_sessions_vocab.getTerm(session).title
     1018        try:
     1019            session = academic_sessions_vocab.getTerm(session).title
     1020        except LookupError:
     1021            session = _('void')
    10151022        creator = getUtility(IPDFCreator, name=orientation)
    10161023        style = getSampleStyleSheet()
Note: See TracChangeset for help on using the changeset viewer.