Fixing local imports.

This commit is contained in:
Roland 2025-12-02 16:07:32 -07:00
parent fb4575dd92
commit 9cb6594ca5
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
6 changed files with 33 additions and 23 deletions

View file

@ -81,6 +81,7 @@ async def get_upload_singlefile(request: Request):
@register_switch_handler('singlefile_upload_switch_handler')
async def singlefile_upload_switch_handler(url=None):
"""Used by `post_upload_singlefile` to upload a single file"""
# Local imports to avoid circular import: downloader -> archive -> api -> downloader
from wrolpi.downloader import Download
from . import ArchiveDownloader
@ -153,7 +154,6 @@ async def generate_screenshot_switch_handler(archive_id=None):
try:
await lib.generate_archive_screenshot(archive_id)
# Always send success event since exceptions are raised on failure
from modules.archive import Archive
archive = lib.get_archive(archive_id=archive_id)
location = archive.location
name = archive.file_group.title or archive.file_group.url