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

Add validation to prevent InvalidCacheKey when fetching resources #2533

Open
kelvin-muchiri opened this issue Jan 4, 2024 · 0 comments
Open

Comments

@kelvin-muchiri
Copy link
Contributor

Environmental Information

  • Onadata version: v3.17.0

Problem description

When an invalid username is used on endpoint /api/v1/profiles/{user} or an invalid primary key is used on endpoint /api/v1/projects/{pk}, the exception InvalidCacheKey is raised

Expected behavior

The API should respond with a 404 status code.

Steps to reproduce the behavior

Try accessing the endpoint /api/v1/profiles/{user} with a username that contains spaces such as /api/v1/profiles/john doe. The API responds with a status code of 500

Additional Information

Logs, related issues, weird / out of place occurrences, local settings, possible approach to solving this...

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

No branches or pull requests

1 participant