From d3e7eb44ea6aeafcdd86031276d5f9ff6ec71ad4 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 11 Sep 2024 12:59:53 +0300 Subject: [PATCH] chore: Linting --- selfprivacy_api/backup/tasks.py | 5 ++--- selfprivacy_api/graphql/common_types/service.py | 2 +- selfprivacy_api/graphql/mutations/services_mutations.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/selfprivacy_api/backup/tasks.py b/selfprivacy_api/backup/tasks.py index 29b9b74..c94db72 100644 --- a/selfprivacy_api/backup/tasks.py +++ b/selfprivacy_api/backup/tasks.py @@ -16,7 +16,7 @@ from huey import crontab from selfprivacy_api.services import ServiceManager, Service from selfprivacy_api.backup import Backups -from selfprivacy_api.backup.jobs import add_autobackup_job, add_total_restore_job +from selfprivacy_api.backup.jobs import add_autobackup_job from selfprivacy_api.jobs import Jobs, JobStatus, Job from selfprivacy_api.jobs.upgrade_system import rebuild_system from selfprivacy_api.actions.system import add_rebuild_job @@ -131,7 +131,6 @@ def back_up_multiple( Jobs.update(job, JobStatus.RUNNING, progress=progress) - def do_total_backup(job: Job) -> None: """ Body of total backup task, broken out to test it @@ -207,7 +206,7 @@ def do_full_restore(job: Job) -> None: Jobs.update( job, JobStatus.RUNNING, - status_text=f"Finding the last autobackup session", + status_text="Finding the last autobackup session", progress=0, ) snapshots_to_restore = which_snapshots_to_full_restore() diff --git a/selfprivacy_api/graphql/common_types/service.py b/selfprivacy_api/graphql/common_types/service.py index 69edf83..ec81945 100644 --- a/selfprivacy_api/graphql/common_types/service.py +++ b/selfprivacy_api/graphql/common_types/service.py @@ -199,7 +199,7 @@ class Service: @strawberry.field def configuration(self) -> Optional[List[ConfigItem]]: """Get service configuration""" - service = get_service_by_id(self.id) + service = ServiceManager.get_service_by_id(self.id) if service is None: return None config_items = service.get_configuration() diff --git a/selfprivacy_api/graphql/mutations/services_mutations.py b/selfprivacy_api/graphql/mutations/services_mutations.py index e76a0b2..48a2b22 100644 --- a/selfprivacy_api/graphql/mutations/services_mutations.py +++ b/selfprivacy_api/graphql/mutations/services_mutations.py @@ -210,7 +210,7 @@ class ServicesMutations: self, input: SetServiceConfigurationInput ) -> ServiceMutationReturn: """Set the new configuration values""" - service = get_service_by_id(input.service_id) + service = ServiceManager.get_service_by_id(input.service_id) if service is None: return ServiceMutationReturn( success=False,