mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +00:00
fix(services): check for possible None progress when moving folders
This commit is contained in:
parent
fb41c092f1
commit
f059c83b57
|
@ -60,6 +60,9 @@ def move_folders_to_volume(
|
||||||
job: Job,
|
job: Job,
|
||||||
) -> None:
|
) -> None:
|
||||||
current_progress = job.progress
|
current_progress = job.progress
|
||||||
|
if current_progress is None:
|
||||||
|
current_progress = 0
|
||||||
|
|
||||||
folder_percentage = 50 // len(folders)
|
folder_percentage = 50 // len(folders)
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
folder_name = get_foldername(folder)
|
folder_name = get_foldername(folder)
|
||||||
|
|
|
@ -311,8 +311,8 @@ class Service(ABC):
|
||||||
Only changes userdata
|
Only changes userdata
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
service_id = cls.get_id()
|
||||||
with WriteUserData() as user_data:
|
with WriteUserData() as user_data:
|
||||||
service_id = cls.get_id()
|
|
||||||
if "modules" not in user_data:
|
if "modules" not in user_data:
|
||||||
user_data["modules"] = {}
|
user_data["modules"] = {}
|
||||||
if service_id not in user_data["modules"]:
|
if service_id not in user_data["modules"]:
|
||||||
|
|
Loading…
Reference in a new issue