ITADN

Fix deprecation warning in `Query.get_or_404()` for SQLAlchemy 2.x

#1405Pull Requestmreid-tt 创建于 2025-10-31
M
mreid-ttcommented
### **Description** This pull request updates `Query.get_or_404()` to remove the use of the deprecated `Query.get()` method, which triggers a `LegacyAPIWarning` under SQLAlchemy 2.x. The change aligns `get_or_404()` with the SQLAlchemy 2.x API by using the session’s `get()` method instead. This preserves existing behavior while ensuring forward compatibility and eliminating the deprecation warning. fixes #1404 ### **Additional Notes** * No behavioral changes are introduced beyond internal API alignment. * `first_or_404()` and `one_or_404()` are unaffected, as they do not use deprecated methods.
合并状态:未合并 关闭于 2025-11-01 4 条评论