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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-03-18 00:12:26 UTC
  • mfrom: (1164 trunk)
  • mto: This revision was merged to the branch mainline in revision 1290.
  • Revision ID: grantw@unimelb.edu.au-20090318001226-fm6rh01lfezetk3x
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
    @named_operation(u'edit')
86
86
    def delete_exercise(self, req, id):
87
87
        
88
 
        if self.context.delete(req.store):
89
 
            return {'result': 'ok'}
90
 
        else:
91
 
            raise BadRequest()
92
 
    
 
88
        self.context.delete()
 
89
        return {'result': 'ok'}
 
90
 
93
91
    @named_operation(u'edit')
94
92
    def add_suite(self, req, description, function, stdin):
95
93
        
129
127
        if suite is None:
130
128
            raise NotFound()
131
129
        
132
 
        suite.delete(req.store)
 
130
        suite.delete()
133
131
        
134
132
        return {'result': 'ok'}
135
133
      
162
160
        ).one()
163
161
        
164
162
        if var is None:
165
 
            raise NotFound()
 
163
            raise NotFound("Var not found.")
166
164
            
167
165
        var.var_type = unicode(var_type)
168
166
        var.var_name = unicode(var_name)
179
177
        if var is None:
180
178
            raise NotFound()
181
179
        
182
 
        var.delete(req.store)
 
180
        var.delete()
183
181
        
184
182
        return {'result': 'ok'}
185
183
        
240
238
        if test_case is None:   
241
239
            raise NotFound()
242
240
 
243
 
        test_case.delete(req.store)
 
241
        test_case.delete()
244
242
 
245
243
        return {'result': 'ok'}
246
244
    
319
317
        if test_part is None:
320
318
            raise NotFound()
321
319
        
322
 
        test_part.delete(req.store)
 
320
        test_part.delete()
323
321
        
324
322
        return {'result': 'ok'}