Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "FlaskPlugin: use
get_id()
instead of id
attr"
This reverts commit 7eda527. This was actually a misinterpretation of the API: The API expects get_id() to be a unique string, that may or may not be an integer. This feature is only used to uniquely identify the user, but its not the same as the user's primary key. https://flask-login.readthedocs.io/en/latest/#your-user-class Please take a note on how get_id() is expected to behave on this feature of flask-login: https://flask-login.readthedocs.io/en/latest/#alternative-tokens This means it can return any arbitrary string to identify the user which can be swapped to any other value to invalidate all sessions. This explicitly states that it is not the same as the user's primary id which is also used as foreign key on the table. sqlalchemy-continuum's transaction tables reference the user with a foreign key of the actual id. If a downstream application uses the alternative-tokens feature as described by the flask-login documentation, this breaks horribly as sqlalchemy-continuum will then try to insert an arbitrary unique string of the user as the foreign key to reference the user in the user table. Fixes kvesteri#316 Caused by kvesteri#149
- Loading branch information