Skip to content

Commit 5de5692

Browse files
committed
Collate code path to minimize complexity
1 parent b60b930 commit 5de5692

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
@@ -199,9 +199,11 @@ def create_performance_definition(
199199

200200
# Separate single models from multiple models
201201
if not isinstance(models, list):
202-
models = [models]
203-
for i, model in enumerate(models):
204-
models[i] = mr.get_model(model)
202+
models = mr.get_model(models)
203+
else:
204+
# Collect all models into a list. This converts the PagedList response from mr.list_models to a normal list.
205+
for i, model in enumerate(models):
206+
models[i] = mr.get_model(model)
205207
if not project:
206208
project = mr.get_project(models[0].projectId)
207209

0 commit comments

Comments
 (0)