You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, hasgeek/flask-lastuser#24 proposes replacing g.user with a current_user proxy, which must be explicitly imported. This is a problem because Flask-Lastuser depends on Coaster. Coaster can't import from Flask-Lastuser.
We can get around this cyclic dependency by making a choice:
Stick with g.user. The problems it causes will remain, such as the possibility of an app's before_request handler attempting to access it before it is set.
Coaster should add a dependency on Flask-Login and import current_user from there. Flask-Lastuser will need to plugin to Flask-Login and replace the user loading mechanism there.
Coaster should provide its own current_user proxy, but allow the backing implementation to be replaced (process-wide). Importing Flask-Lastuser into the same process will automatically apply this replacement.
The text was updated successfully, but these errors were encountered:
Choice 1 is clearly not viable any further. Flask-Login makes assumptions about users that aren't necessarily compatible with Lastuser, so we should not add a dependency to it.
If we take choice 3, we need to demonstrate that Coaster's current_user proxy can be compatible with both Flask-Login and Flask-Lastuser.
Coaster currently expects a
g.user
entity inload_models
. If the implementation for hasgeek/baseframe#80 (CRUD views) is moved to Coaster, that will add a second reference tog.user
.However, hasgeek/flask-lastuser#24 proposes replacing
g.user
with acurrent_user
proxy, which must be explicitly imported. This is a problem because Flask-Lastuser depends on Coaster. Coaster can't import from Flask-Lastuser.We can get around this cyclic dependency by making a choice:
Stick with
g.user
. The problems it causes will remain, such as the possibility of an app'sbefore_request
handler attempting to access it before it is set.Coaster should add a dependency on Flask-Login and import
current_user
from there. Flask-Lastuser will need to plugin to Flask-Login and replace the user loading mechanism there.Coaster should provide its own
current_user
proxy, but allow the backing implementation to be replaced (process-wide). Importing Flask-Lastuser into the same process will automatically apply this replacement.The text was updated successfully, but these errors were encountered: