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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/service.py

  • Committer: David Coles
  • Date: 2010-07-20 05:55:20 UTC
  • Revision ID: coles.david@gmail.com-20100720055520-yxyfn2qqycfwboiq
URL quote paths in checkout URLs.

The two benefits of this are that we no longer have issues with spaces in 
submitted paths and also don't have to worry about shell escape characters 
(and possible shell injection to a lectures console).

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from ivle.database import Exercise, ExerciseAttempt, ExerciseSave, Worksheet, \
29
29
                          Offering, Subject, Semester, User, WorksheetExercise
30
30
import ivle.worksheet.utils
31
 
from ivle.webapp.base.rest import (JSONRESTView, named_operation,
 
31
from ivle.webapp.base.rest import (JSONRESTView, write_operation,
32
32
                                   require_permission)
33
33
from ivle.webapp.errors import NotFound
34
34
 
91
91
class WorksheetExerciseRESTView(JSONRESTView):
92
92
    '''REST view of a worksheet exercise.'''
93
93
 
94
 
    @named_operation('view')
 
94
    @write_operation('view')
95
95
    def save(self, req, text):
96
96
        # Find the appropriate WorksheetExercise to save to. If its not found,
97
97
        # the user is submitting against a non-existant worksheet/exercise
118
118
class WorksheetsRESTView(JSONRESTView):
119
119
    """View used to update and create Worksheets."""
120
120
 
121
 
    @named_operation('edit_worksheets')
 
121
    @write_operation('edit_worksheets')
122
122
    def move_up(self, req, worksheetid):
123
123
        """Takes a list of worksheet-seq_no pairs and updates their 
124
124
        corresponding Worksheet objects to match."""
139
139
        
140
140
        return {'result': 'ok'}
141
141
 
142
 
    @named_operation('edit_worksheets')
 
142
    @write_operation('edit_worksheets')
143
143
    def move_down(self, req, worksheetid):
144
144
        """Takes a list of worksheet-seq_no pairs and updates their 
145
145
        corresponding Worksheet objects to match."""