Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase case id range #2684

Merged
merged 9 commits into from
Dec 6, 2023
9 changes: 1 addition & 8 deletions cg/store/api/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,7 @@ def add_case(
) -> Case:
"""Build a new Case record."""

# generate a unique case id
while True:
internal_id = petname.Generate(2, separator="")
if self.get_case_by_internal_id(internal_id) is None:
break
else:
LOG.debug(f"{internal_id} already used - trying another id")

internal_id: str = self.generate_unique_petname()
seallard marked this conversation as resolved.
Show resolved Hide resolved
return Case(
cohorts=cohorts,
data_analysis=str(data_analysis),
Expand Down