Skip to content

Commit 79e0182

Browse files
committed
Collate code path to minimize complexity
1 parent b48a137 commit 79e0182

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sasctl/_services/model_management.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ def create_performance_definition(
196196

197197
# Separate single models from multiple models
198198
if not isinstance(models, list):
199-
models = [models]
200-
for i, model in enumerate(models):
201-
models[i] = mr.get_model(model)
199+
models = mr.get_model(models)
200+
else:
201+
# Collect all models into a list. This converts the PagedList response from mr.list_models to a normal list.
202+
for i, model in enumerate(models):
203+
models[i] = mr.get_model(model)
202204
if not project:
203205
project = mr.get_project(models[0].projectId)
204206

0 commit comments

Comments
 (0)