From 06917c71ae2d4a820a9d0c5943de21de2e100102 Mon Sep 17 00:00:00 2001 From: Kim Gustyr Date: Tue, 7 May 2024 17:27:38 +0100 Subject: [PATCH] better code --- api/features/features_service.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/api/features/features_service.py b/api/features/features_service.py index e0714ce42ee3..3150f2badafc 100644 --- a/api/features/features_service.py +++ b/api/features/features_service.py @@ -24,22 +24,21 @@ def get_overrides_data( :return: overrides data getter """ project = environment.project - match project.enable_dynamo_db, project.edge_v2_identity_overrides_migrated: - case True, True: + + if project.enable_dynamo_db: + if project.edge_v2_identity_overrides_migrated: # If v2 migration is complete, count segment overrides from Core # and identity overrides from DynamoDB. return get_edge_overrides_data(environment) - case True, _: - # If v2 migration is not started, in progress, or incomplete, - # only count segment overrides from Core. - # v1 Edge identity overrides are uncountable. - return get_core_overrides_data( - environment, - skip_identity_overrides=True, - ) - case _, _: - # For projects still fully on Core, count all overrides from Core. - return get_core_overrides_data(environment) + # If v2 migration is not started, in progress, or incomplete, + # only count segment overrides from Core. + # v1 Edge identity overrides are uncountable. + return get_core_overrides_data( + environment, + skip_identity_overrides=True, + ) + # For projects still fully on Core, count all overrides from Core. + return get_core_overrides_data(environment) def get_core_overrides_data(