Fix NameError: folders_str is not defined

This commit is contained in:
Martin Tranberg
2026-03-26 10:45:10 +01:00
parent 0f7c5fff1f
commit 407e58baec

View File

@@ -135,13 +135,10 @@ def main():
client_secret = config.get('CLIENT_SECRET')
site_url = config.get('SITE_URL')
drive_name = config.get('DOCUMENT_LIBRARY')
folders_to_download_str = config.get('FOLDERS_TO_DOWNLOAD')
local_path_base = config.get('LOCAL_PATH').replace('\\', os.sep)
folders_to_download_str = config.get('FOLDERS_TO_DOWNLOAD', '')
local_path_base = config.get('LOCAL_PATH', '').replace('\\', os.sep)
folders_to_download = [f.strip() for f in folders_str.split(',')] if 'FOLDERS_TO_DOWNLOAD' in config else []
# Safeguard if FOLDERS_TO_DOWNLOAD is missing
if not folders_to_download:
folders_to_download = [f.strip() for f in folders_to_download_str.split(',')]
folders_to_download = [f.strip() for f in folders_to_download_str.split(',') if f.strip()]
print(f"Connecting via Graph API (with auto-refresh and skip logic)...")