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

« back to all changes in this revision

Viewing changes to ivle/database.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:
515
515
        else:
516
516
            return self.offering.students
517
517
 
 
518
class DeadlinePassed(Exception):
 
519
    """An exception indicating that a project cannot be submitted because the
 
520
    deadline has passed."""
 
521
    def __init__(self):
 
522
        pass
 
523
    def __str__(self):
 
524
        return "The project deadline has passed"
 
525
 
518
526
class Project(Storm):
519
527
    """A student project for which submissions can be made."""
520
528
 
556
564
        """
557
565
 
558
566
        if not self.can_submit(principal, who):
559
 
            raise Exception('cannot submit')
 
567
            raise DeadlinePassed()
560
568
 
561
569
        a = Assessed.get(Store.of(self), principal, self)
562
570
        ps = ProjectSubmission()