Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] Modify /registry/score/{scorer_id}/{address} and /registry/score/{scorer_id} to accept strings for scorer_id #243

Open
tim-schultz opened this issue May 15, 2023 · 0 comments

Comments

@tim-schultz
Copy link
Contributor

Follow up to passportxyz/passport#1041

1041 added the ability to create a scorer with an external id. The /registry/score/{scorer_id}/{address} and /registry/score/{scorer_id} endpoints should be modified so that they can accept a string or an integer for scorer_id.

The query to retrieve to retrieve a scorer by id or external_scorer_id should already be satisfied with

def get_scorer_by_id(scorer_id: int | str, account: Account) -> Community:
    try:
        return Community.objects.get(external_scorer_id=scorer_id, account=account)
    except Exception:
        return api_get_object_or_404(Community, id=scorer_id, account=account)

This ticket should just update the endpoint parameter type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant