Exemple #1
0
 def test_remove_shot(self):
     shot_id = str(self.shot.id)
     asset_id = str(self.asset.id)
     breakdown_service.create_casting_link(shot_id, asset_id)
     shots_service.remove_shot(shot_id)
     with pytest.raises(ShotNotFoundException):
         shots_service.get_shot(shot_id)
Exemple #2
0
 def delete(self, shot_id):
     """
     Delete given shot.
     """
     force = self.get_force()
     shot = shots_service.get_shot(shot_id)
     user_service.check_manager_project_access(shot["project_id"])
     shots_service.remove_shot(shot_id, force=force)
     return "", 204
Exemple #3
0
    def delete(self, shot_id):
        try:
            permissions.check_manager_permissions()
            deleted_shot = shots_service.remove_shot(shot_id)
        except ShotNotFoundException:
            abort(404)
        except permissions.PermissionDenied:
            abort(403)

        return deleted_shot, 204
Exemple #4
0
    def delete(self, shot_id):
        """
        Delete given shot.
        """
        try:
            parser = reqparse.RequestParser()
            parser.add_argument("force", default=False, type=bool)
            args = parser.parse_args()
            force = args["force"]

            permissions.check_manager_permissions()
            if force:
                permissions.check_admin_permissions()
            deleted_shot = shots_service.remove_shot(shot_id, force=force)
        except ShotNotFoundException:
            abort(404)
        except permissions.PermissionDenied:
            abort(403)

        return deleted_shot, 204
Exemple #5
0
    def delete(self, shot_id):
        """
        Delete given shot.
        """
        try:
            parser = reqparse.RequestParser()
            parser.add_argument("force", default=False, type=bool)
            args = parser.parse_args()
            force = args["force"]

            shot = shots_service.get_shot(shot_id)
            user_service.check_manager_project_access(shot["project_id"])

            deleted_shot = shots_service.remove_shot(shot_id, force=force)
        except ShotNotFoundException:
            abort(404)
        except permissions.PermissionDenied:
            abort(403)

        return '', 204