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

Unhandled exception on calculate_streak endpoint #94

Open
jaymeklein opened this issue Mar 4, 2024 · 1 comment
Open

Unhandled exception on calculate_streak endpoint #94

jaymeklein opened this issue Mar 4, 2024 · 1 comment

Comments

@jaymeklein
Copy link
Contributor

While testing the calculate_streak endpoint, i faced the following exception:

  File "Flashcard-App\backend\routes\api\statistics.py", line 203, in calculate_streak
    last_streak = stats["lastStreak"]
                  ^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Testing with valid data, it returns a proper {'success': True} message, i had no problems with valid data.

But when it comes to testing with non-existent data, userID in this case, shouldn't the endpoint return something like "User not found" or {'success': False}?

@jacob-macleod
Copy link
Owner

Thanks, I'll look at this when I next have time

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

2 participants