Skip to content

Commit

Permalink
Move check into _start_experiment_session method
Browse files Browse the repository at this point in the history
  • Loading branch information
SmittieC committed Sep 18, 2024
1 parent 38819d2 commit 0a38ec6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/chat/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ def start_new_session(
timezone: str | None = None,
session_external_id: str | None = None,
):
if working_experiment.is_versioned:
raise VersionedExperimentSessionsNotAllowedException(
message="A session cannot be linked to an experiment version. "
)

return _start_experiment_session(
working_experiment,
experiment_channel,
Expand Down Expand Up @@ -775,6 +770,11 @@ def _start_experiment_session(
timezone: str | None = None,
session_external_id: str | None = None,
) -> ExperimentSession:
if working_experiment.is_versioned:
raise VersionedExperimentSessionsNotAllowedException(
message="A session cannot be linked to an experiment version. "
)

team = working_experiment.team
if not participant_identifier and not participant_user:
raise ValueError("Either participant_identifier or participant_user must be specified!")
Expand Down

0 comments on commit 0a38ec6

Please sign in to comment.