Check if project matches the content_object.project.

remotes/origin/enhancement/email-actions
Andrey Antukh 2014-09-05 22:30:55 +02:00
parent 6dc0168836
commit 4b6d666818
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ class BaseAttachmentViewSet(HistoryResourceMixin, WatchedResourceMixin, ModelCru
obj.content_type = self.get_content_type() obj.content_type = self.get_content_type()
obj.owner = self.request.user obj.owner = self.request.user
if obj.project_id != obj.content_object.project_id:
raise exc.WrongArguments("Project ID not matches between object and project")
super().pre_save(obj) super().pre_save(obj)
def post_delete(self, obj): def post_delete(self, obj):