Ignore:
Timestamp:
4 Nov 2016, 05:23:01 (8 years ago)
Author:
Henrik Bettermann
Message:

Catch Reportlab LayoutError.

File:
1 edited

Legend:

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

    r14213 r14256  
    2525from reportlab.lib.styles import getSampleStyleSheet
    2626from reportlab.platypus import Paragraph, Image, Table, Spacer
     27from reportlab.platypus.doctemplate import LayoutError
    2728from zope.event import notify
    2829from zope.schema.interfaces import ConstraintNotSatisfied
     
    800801            view.flash('Error in image file.')
    801802            return view.redirect(view.url(view.context))
     803        except LayoutError, err:
     804            view.flash(
     805                'PDF file could not be created. Reportlab error message: %s'
     806                % escape(err.message),
     807                type="danger")
     808            return view.redirect(view.url(view.context))
    802809        return pdf_stream
    803810
Note: See TracChangeset for help on using the changeset viewer.