~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 06:54:39 UTC
  • Revision ID: matt.giuca@gmail.com-20100211065439-kv2pi94cmz8a8dvu
All checks if a project deadline has passed call Project.has_deadline_passed, rather than manually checking with the current time. Important if the abstracted function changes to respect extensions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
541
541
        return "<%s '%s' in %r>" % (type(self).__name__, self.short_name,
542
542
                                  self.project_set.offering)
543
543
 
544
 
    def can_submit(self, principal):
 
544
    def can_submit(self, principal, user):
545
545
        return (self in principal.get_projects() and
546
 
                self.deadline > datetime.datetime.now())
 
546
                not self.has_deadline_passed(user))
547
547
 
548
548
    def submit(self, principal, path, revision, who):
549
549
        """Submit a Subversion path and revision to a project.
555
555
        @param who: The user who is actually making the submission.
556
556
        """
557
557
 
558
 
        if not self.can_submit(principal):
 
558
        if not self.can_submit(principal, who):
559
559
            raise Exception('cannot submit')
560
560
 
561
561
        a = Assessed.get(Store.of(self), principal, self)