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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-03-31 01:05:08 UTC
  • mto: (1165.3.1 submissions)
  • mto: This revision was merged to the branch mainline in revision 1174.
  • Revision ID: grantw@unimelb.edu.au-20090331010508-scw79jwt11uk4kjj
400 if a non-matching project is POSTed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        # at the first two path segments. The first tells us the type.
45
45
        self.context = self.get_repository_owner(req.store, name)
46
46
        self.path = os.path.normpath(path)
 
47
        self.offering = self.get_offering()
47
48
 
48
49
        if self.context is None:
49
50
            raise NotFound()
69
70
 
70
71
            project = req.store.find(Project, Project.id == projectid).one()
71
72
 
 
73
            # This view's offering will be the sole offering for which the
 
74
            # path is permissible. We need to check that.
 
75
            if project.project_set.offering is not self.offering:
 
76
                raise BadRequest('Path is not permissible for this offering')
 
77
 
72
78
            if project is None:
73
79
                raise BadRequest('Specified project does not exist')
74
80
 
75
81
            project.submit(self.context, self.path, 1) # XXX: Fix rev.
76
82
 
77
83
        ctx['principal'] = self.context
78
 
        ctx['offering'] = self.get_offering()
 
84
        ctx['offering'] = self.offering
79
85
        ctx['path'] = self.path
80
86
        ctx['now'] = datetime.datetime.now()
81
87
        ctx['format_datetime'] = ivle.date.format_datetime_for_paragraph