chore(): small improvements
This commit is contained in:
@@ -145,7 +145,10 @@ def _check_participation_limits(
|
||||
return not recent_completed
|
||||
|
||||
|
||||
def _check_domain_conflicts(experiment: Experiment) -> bool:
|
||||
def _check_domain_conflicts(
|
||||
experiment: Experiment,
|
||||
subject_id: str,
|
||||
) -> bool:
|
||||
memberships = ExperimentConflictDomain.objects.filter(
|
||||
experiment=experiment,
|
||||
).select_related("conflict_domain")
|
||||
@@ -154,7 +157,7 @@ def _check_domain_conflicts(experiment: Experiment) -> bool:
|
||||
if not resolve_domain_conflict(
|
||||
experiment_id=experiment.pk,
|
||||
domain_id=membership.conflict_domain_id,
|
||||
subject_id="",
|
||||
subject_id=subject_id,
|
||||
):
|
||||
return False
|
||||
return True
|
||||
@@ -219,7 +222,7 @@ def decide_for_flag(
|
||||
_persist_decision(result, subject_id)
|
||||
return result
|
||||
|
||||
if not _check_domain_conflicts(experiment):
|
||||
if not _check_domain_conflicts(experiment, subject_id):
|
||||
DECIDE_REQUESTS.labels(reason="domain_conflict").inc()
|
||||
result = {
|
||||
"flag": flag_key,
|
||||
|
||||
Reference in New Issue
Block a user