Skip to content

Commit a800c72

Browse files
cmaloneyclaude
andcommitted
Use try/except to parse the environment id
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bd03c98 commit a800c72

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎codespeed/views_data.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def get_default_environment(enviros, data, multi=False):
4646
if 'env' in data:
4747
for env_value in data['env'].split(","):
4848
# Report links use the name, other permalinks the id
49-
env_id = int(env_value) if env_value.isdecimal() else None
49+
try:
50+
env_id = int(env_value)
51+
except ValueError:
52+
env_id = None
5053
for env in enviros:
5154
if env.id == env_id or env.name == env_value:
5255
defaultenviros.append(env)

0 commit comments

Comments
 (0)