Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils: fix get_unique_keys() when model has no table attached to it
Using the internal SQLAlchemy __table__ to find unique keys on a model class does not work if the model is not attached to a class. In this case, it seems there is no way to find what the keys are: rather than crashing or returning garbage, the function just returns None, indicating it does not know how to get it. The warning from paginate_query() is not emitted in this case, as there's no way to guess if the developer did wrong or not. Change-Id: I1291fe1f1e78471f18f230a66edff31ed199bc7a
- Loading branch information
Showing
2 changed files
with
60 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters