~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 03:56:36 UTC
  • mto: (1165.3.1 submissions)
  • mto: This revision was merged to the branch mainline in revision 1174.
  • Revision ID: grantw@unimelb.edu.au-20090331035636-emxbfwn3q9sgs70u
Take the revision to submit from the query string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    def populate(self, req, ctx):
61
61
        if req.method == 'POST':
62
62
            data = dict(req.get_fieldstorage())
 
63
            if 'revision' not in data:
 
64
                raise BadRequest('"revision" argument required')
 
65
 
 
66
            try:
 
67
                revision = int(data['revision'])
 
68
            except ValueError:
 
69
                raise BadRequest('"revision" must be an integer')
 
70
 
63
71
            if 'project' not in data:
64
72
                raise BadRequest('"project" argument required')
65
73
 
78
86
            if project is None:
79
87
                raise BadRequest('Specified project does not exist')
80
88
 
81
 
            project.submit(self.context, self.path, 1) # XXX: Fix rev.
 
89
            project.submit(self.context, self.path, revision)
82
90
 
83
91
        ctx['principal'] = self.context
84
92
        ctx['offering'] = self.offering