def delete_channel( channel: db_models.Channel = Depends(get_channel_allow_proxy), dao: Dao = Depends(get_dao), auth: authorization.Rules = Depends(get_rules), ): auth.assert_delete_channel(channel) dao.delete_channel(channel.name) files = pkgstore.list_files(channel.name) for f in files: pkgstore.delete_file(channel.name, destination=f)
def delete_channel( channel: db_models.Channel = Depends(get_channel_allow_proxy), dao: Dao = Depends(get_dao), auth: authorization.Rules = Depends(get_rules), ): auth.assert_delete_channel(channel) dao.delete_channel(channel.name) try: pkgstore.remove_channel(channel.name) except FileNotFoundError: logger.warning( f"trying to remove non-existent package store for channel {channel.name}" )