Merge pull request #19450 from edx/tuchfarber/fix_experiment_integrity_error
Ignore integrity error in revenue holdback experiment
This commit is contained in:
@@ -4,6 +4,7 @@ Content type gating waffle flag
|
||||
import random
|
||||
|
||||
from django.dispatch import receiver
|
||||
from django.db import IntegrityError
|
||||
|
||||
from experiments.models import ExperimentData, ExperimentKeyValue
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleFlagNamespace, WaffleFlag
|
||||
@@ -55,3 +56,8 @@ def set_value_for_content_type_gating_holdback(sender, event=None, user=None, **
|
||||
)
|
||||
except (ExperimentKeyValue.DoesNotExist, AttributeError):
|
||||
pass
|
||||
except IntegrityError:
|
||||
# There is a race condition when multiple enrollments happen at the same time where the ExperimentData
|
||||
# row for one enrollment is created between the duplicate check and creation for the other enrollment.
|
||||
# Since we're ignoring skipping duplicate entries anyway, this is safe to ignore.
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user