Closed YlguYtrid closed 4 months ago
I can't reproduce this issue. It sounds like you have a different error. The tests pass currently, the suggested change would break them.
I can't reproduce this issue. It sounds like you have a different error. The tests pass currently, the suggested change would break them.
I read the docstring again. I realized I made a mistake. This method is replace None to 404 error. I thought it is replace 404 error to None.
I tried to rewrite the legacy query method to new api. Then I run coverage and find 'db.first_or_404(db.select(User))' still cause 404 Error.
I read the 'first_or_404' function code.It's same as:
I think the code is wrong, then I rewrite it as:
Now I retest coverage. All tests passed.
Environment: