def remove_from_project(self, project, next):
        """
        Similar to L{add_to_project} but does the reverse, deleting the
        permission from the project using::
        
            from expedient.common.permissions.shortcuts import \
                delete_permission
                
            delete_permission("can_use_aggregate", self.as_leaf_class(), project)
            
        and then redirecting to C{next}. Additionally, if not overridden,
        this function stops all slices in the project before removing the
        aggregate. Subclasses should also stop slices.
        """
        must_have_permission("user", self.as_leaf_class(), "can_use_aggregate")
        
        prefix = self.__class__.get_url_name_prefix()
        try:
            return reverse(prefix % "%s_aggregate_project_remove",
                           kwargs={'agg_id': self.id,
                                   'proj_id': project.id})+"?next=%s" % next
        except NoReverseMatch:
            # Stop all the slices in the project for this aggregate.
            for slice in project.slice_set.all():
                try:
                    self.as_leaf_class().stop_slice(slice)
                except:
                    pass
                # Carolina: remove permision for aggregate in every slice inside the project
                self.remove_from_slice(slice, next)
            delete_permission("can_use_aggregate", self.as_leaf_class(), project)
            return next
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/clearinghouse/aggregate/models.py/Aggregate.remove_from_project/swapped operands of `%`