Skip to content

Commit 39ab0b0

Browse files
committed
comments from main forced decision PR resolved
1 parent ed543fa commit 39ab0b0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

optimizely/decision_service.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,21 @@ def get_variation_for_rollout(self, project_config, feature, user):
356356
return Decision(None, None, enums.DecisionSources.ROLLOUT), decide_reasons
357357

358358
rollout = project_config.get_rollout_from_id(feature.rolloutId)
359-
rollout_rules = project_config.get_rollout_experiments(rollout)
360359

361-
if not rollout or not rollout_rules:
360+
if not rollout:
362361
message = 'There is no rollout of feature {}.'.format(feature.key)
363362
self.logger.debug(message)
364363
decide_reasons.append(message)
365364
return Decision(None, None, enums.DecisionSources.ROLLOUT), decide_reasons
366365

366+
rollout_rules = project_config.get_rollout_experiments(rollout)
367+
368+
if not rollout_rules:
369+
message = 'Rollout {} has no experiments.'.format(rollout.id)
370+
self.logger.debug(message)
371+
decide_reasons.append(message)
372+
return Decision(None, None, enums.DecisionSources.ROLLOUT), decide_reasons
373+
367374
index = 0
368375
while index < len(rollout_rules):
369376
skip_to_everyone_else = False
@@ -478,4 +485,7 @@ def get_variation_for_feature(self, project_config, feature, user_context, optio
478485
message = 'User "{}" is not bucketed into any of the experiments on the feature "{}".'.format(
479486
user_context.user_id, feature.key)
480487
self.logger.debug(message)
481-
return self.get_variation_for_rollout(project_config, feature, user_context)
488+
variation, rollout_variation_reasons = self.get_variation_for_rollout(project_config, feature, user_context)
489+
if rollout_variation_reasons:
490+
decide_reasons += rollout_variation_reasons
491+
return variation, decide_reasons

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy