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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-02-11 07:11:18 UTC
  • Revision ID: matt.giuca@gmail.com-20100211071118-porrkurotrvo04bs
submit: Now produces a graceful user error if submitting a project after the deadline (forbidden by HTML, but still possible and not due to malice). Previously resulted in an internal server error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
from storm.locals import Store
26
26
 
 
27
from ivle import database
27
28
from ivle.database import (User, ProjectGroup, Offering, Subject, Semester,
28
29
                           ProjectSet, Project, Enrolment)
29
30
from ivle.webapp.errors import NotFound, BadRequest
94
95
            if project is None:
95
96
                raise BadRequest('Specified project does not exist.')
96
97
 
97
 
            project.submit(self.context, unicode(self.path), revision, req.user)
 
98
            try:
 
99
                project.submit(self.context, unicode(self.path), revision,
 
100
                               req.user)
 
101
            except database.DeadlinePassed, e:
 
102
                raise BadRequest(str(e) + ".")
98
103
 
99
104
            # The Subversion configuration needs to be updated, to grant
100
105
            # tutors and lecturers access to this submission. We have to