~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/__init__.py

  • Committer: David Coles
  • Date: 2010-02-24 21:30:30 UTC
  • Revision ID: coles.david@gmail.com-20100224213030-k97zu2b9c62ezszk
worksheets: Catch and nicely display SystemMessage thrown by docutils if we can't generate XML from rST when saving a worksheet

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
                errors = {'data': 'Could not parse XML: %s' % e.message}
367
367
            except ivle.worksheet.utils.ExerciseNotFound, e:
368
368
                errors = {'data': 'Could not find exercise "%s"' % e.message}
 
369
            except docutils.utils.SystemMessage, e:
 
370
                errors = {'data': 'Could not parse reStructuredText: %s'%(
 
371
                        e.message)}
369
372
        else:
370
373
            data = self.get_default_data(req)
371
374
            errors = {}