Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DB fetching on not found entries
Whenever a GET call to a non-existent object is requested, the server would not return a proper `404` code response. Instead, it returned a `500`, because `.to_dict()` was called upon the not found object directly (which should be `None`). This patch makes sure that `.to_dict()` is only called upon existing DB models, and as a result, it will return a `404` response on not found objects.
- Loading branch information