Add option to purge storages when removing repos
The following discussion from !104 (merged) should be addressed:
@grote started a discussion:
@receiver(post_delete, sender=Repository)
def repository_post_delete_handler(**kwargs):
repo = kwargs['instance']
logging.info("Deleting Repo: %s", repo.name)
repo_local_path = repo.get_path()
if os.path.exists(repo_local_path):
rmtree(repo_local_path)
repo_private_path = repo.get_private_path()
if os.path.exists(repo_private_path):
rmtree(repo_private_path)
from maker.models.storage import StorageManager
default_storages = StorageManager.get_default_storage(repo)
for default_storage in default_storages:
rmtree(os.path.join(default_storage.path, get_repo_root_path(repo)))
This last part should probably be optional. Maybe there can be a checkbox on the confirmation screen to also purge the repo from all remote storages?