Skip to content

Commit

Permalink
Use exact search when resolving sso name (#673)
Browse files Browse the repository at this point in the history
* Update documentation

* Use exact search when resolving sso name
  • Loading branch information
JulienPeloton authored Oct 16, 2024
1 parent d52866d commit 592e6bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/sso/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def resolve_sso_name_to_ssnamenr(sso_name):
# search all ssnamenr corresponding quaero -> ssnamenr
r = requests.post(
"https://fink-portal.org/api/v1/resolver",
json={"resolver": "ssodnet", "name": sso_name},
json={"resolver": "ssodnet", "name": sso_name, "nmax": 1},
)
if r.status_code != 200:
return []
Expand Down
6 changes: 6 additions & 0 deletions tests/api_sso_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def test_multiple_sso_names() -> None:
assert len(pdf["sso_name"].unique()) == 1, pdf["sso_name"].unique()
assert len(pdf["i:ssnamenr"].unique()) == 3, pdf["i:ssnamenr"].unique()

# however we do not want Rubin & Rubincam
pdf = ssosearch(n_or_d="Rubin")

assert len(pdf["sso_name"].unique()) == 1, pdf["sso_name"].unique()
assert len(pdf["i:ssnamenr"].unique()) == 1, pdf["i:ssnamenr"].unique()


def test_bad_request() -> None:
"""
Expand Down

0 comments on commit 592e6bd

Please sign in to comment.