api : avoid PUT request with a list of projects.
authorcavaliet
Thu, 17 Jan 2013 11:35:19 +0100
changeset 1069 a692c2d0cef7
parent 1068 7271a5549682
child 1070 e1b6be4d85a4
api : avoid PUT request with a list of projects.
src/ldt/ldt/api/ldt/resources/project.py
--- a/src/ldt/ldt/api/ldt/resources/project.py	Wed Jan 16 05:34:32 2013 +0100
+++ b/src/ldt/ldt/api/ldt/resources/project.py	Thu Jan 17 11:35:19 2013 +0100
@@ -11,6 +11,7 @@
 from tastypie.authorization import Authorization
 from tastypie.resources import Bundle, ModelResource, ALL
 from tastypie import fields
+from tastypie.exceptions import BadRequest
 
 
 class ProjectResource(ModelResource):
@@ -63,4 +64,7 @@
         assign('ldt_utils.view_project', everyone, bundle.obj)
         protect_models()
         return bundle
+    
+    def obj_delete_list(self, request=None, **kwargs):
+        raise BadRequest("PUT with a list of projects is forbidden.")
     
\ No newline at end of file