Skip to content

Commit

Permalink
Edit create method to retun list
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Nov 22, 2023
1 parent 8982784 commit f372090
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/managers/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def create(self, trans: ProvidesAppContext, payload: GroupCreatePayload):
encoded_id = DecodedDatabaseIdField.encode(group.id)
item = group.to_dict(view="element", value_mapper={"id": DecodedDatabaseIdField.encode})
item["url"] = self._url_for(trans, "create", group_id=encoded_id)
return item
return [item]

def show(self, trans: ProvidesAppContext, group_id: int):
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create(
self,
trans: ProvidesAppContext = DependsOnTrans,
payload: GroupCreatePayload = Body(...),
) -> GroupResponse:
) -> GroupListResponse:
return self.manager.create(trans, payload)

@router.get(
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy_test/api/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_create_valid(self, group_name: Optional[str] = None):
payload = self._build_valid_group_payload(group_name)
response = self._post("groups", payload, admin=True, json=True)
self._assert_status_code_is(response, 200)
group = response.json()
group = response.json()[0] # POST /api/groups returns a list
self._assert_valid_group(group)
return group

Expand Down

0 comments on commit f372090

Please sign in to comment.