From 78dec5c3478d9fcfebb45018b3eec4f87e0e9719 Mon Sep 17 00:00:00 2001 From: dettlaff Date: Sun, 16 Jun 2024 11:59:01 +0400 Subject: [PATCH] feat: move get_subdomain to parent class --- selfprivacy_api/migrations/update_services_flake_list.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/selfprivacy_api/migrations/update_services_flake_list.py b/selfprivacy_api/migrations/update_services_flake_list.py index 8d3b8e8..6f23903 100644 --- a/selfprivacy_api/migrations/update_services_flake_list.py +++ b/selfprivacy_api/migrations/update_services_flake_list.py @@ -25,10 +25,13 @@ class UpdateServicesFlakeList(Migration): return "Check if all required services are in the flake list" def is_migration_needed(self): - with FlakeServiceManager: - if not manager.services == CORRECT_SERVICES_LIST: + # this do not delete custom links for testing + for key, value in manager.services.items(): + if key not in CORRECT_SERVICES_LIST: return True def migrate(self): with FlakeServiceManager: - manager.services = CORRECT_SERVICES_LIST + for key, value in CORRECT_SERVICES_LIST.items(): + if key not in manager.services: + manager.services[key] = value