Beispiel #1
0
 def perform_create(self, serializer):
     team_video = serializer.validated_data['team_video']
     if not team_permissions.can_assign_tasks(self.team, self.request.user,
                                              team_video.project):
         raise PermissionDenied()
     self.task_was_assigned = False
     task = serializer.save()
     self._post_save(task)
Beispiel #2
0
 def perform_update(self, serializer):
     team_video = serializer.instance.team_video
     if not team_permissions.can_assign_tasks(self.team, self.request.user,
                                              team_video.project):
         raise PermissionDenied()
     self.task_was_assigned = serializer.instance.assignee is not None
     task = serializer.save()
     self._post_save(task)