def remove_from_slice(self, slice, next):
        """
        Works exactly the same as L{remove_from_project} but for a slice.
        It stops the slice if not overridden. Subclasses should stop the
        slice before removing the permission.
        """
        must_have_permission("user", self.as_leaf_class(), "can_use_aggregate")
        must_have_permission("project", self.as_leaf_class(), "can_use_aggregate")

        prefix = self.__class__.get_url_name_prefix()
        try:
            return reverse("%s_aggregate_slice_remove" % prefix,
                           kwargs={'agg_id': self.id,
                                   'slice_id': slice.id})+"?next=%s" % next
        except NoReverseMatch:
            try:
                self.as_leaf_class().stop_slice(slice)
            except:
                pass
            delete_permission("can_use_aggregate", self.as_leaf_class(), slice)
            return next
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/clearinghouse/aggregate/models.py/Aggregate.remove_from_slice/original