Skip to content

Commit

Permalink
collaborations_count bugfix for #1059
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 29, 2025
1 parent e59b9cf commit 69e3e6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/api/organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def valid_co(collaboration_json):

valid_collaborations = [co for co in json_organisation.get("collaborations", []) if valid_co(co)]
json_organisation["collaborations"] = valid_collaborations
json_organisation["collaborations_count"] = len(valid_collaborations)

for json_collaboration in json_organisation.get("collaborations", []):
for group in json_collaboration.get("groups", []):
Expand Down
1 change: 1 addition & 0 deletions server/test/api/test_organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ def test_find_api_unit_access(self):
with_basic_auth=False)
collaborations = res["collaborations"]
self.assertEqual(1, len(collaborations))
self.assertEqual(1, res["collaborations_count"])
self.assertEqual(co_ai_computing_name, collaborations[0]["name"])
# Test logic that determined the filtering of CO's with no units or other units than the used ApiKey
api_key = ApiKey.query.filter(ApiKey.hashed_secret == unihard_hashed_secret_unit_support).one()
Expand Down

0 comments on commit 69e3e6a

Please sign in to comment.