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}?
While testing the
calculate_streak
endpoint, i faced the following exception: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}
?