Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask View redirects on save are broken #1219

Closed
bkyryliuk opened this issue Sep 29, 2016 · 5 comments
Closed

Flask View redirects on save are broken #1219

bkyryliuk opened this issue Sep 29, 2016 · 5 comments
Assignees
Labels
airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead

Comments

@bkyryliuk
Copy link
Member

Caravel has a weird redirection after saving the model in caravel, for instance when I save https://caravel_host/tablemodelview/edit/1647 - it redirects me to the random model lists like database, slice, etc...

@bkyryliuk bkyryliuk added airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead labels Sep 29, 2016
@bkyryliuk bkyryliuk self-assigned this Sep 29, 2016
@bkyryliuk
Copy link
Member Author

Looks like @mistercrunch was on top of it:
dpgaspar/Flask-AppBuilder#318

@bkyryliuk
Copy link
Member Author

bkyryliuk commented Sep 29, 2016

While debugging I was able to get:

from flask import session
print(session['page_history'])
[u'http://localhost:8081/tablemodelview/list/', u'http://localhost:8081/dashboardmodelview/list/', u'http://localhost:8081/slicemodelview/list/', u'http://localhost:8081/tablemodelview/list/', u'http://localhost:8081/dashboardmodelview/edit/99']
session['page_history']

FAB uses prev url for the redirect:
https://github.com/dpgaspar/Flask-AppBuilder/blob/af095ac4094d068fa2dd467bd01fa8b95d697fc1/flask_appbuilder/baseviews.py#L193

Once the history didn't have any http://localhost:8081/dashboardmodelview/edit/XX

[u'http://localhost:8081/tablemodelview/list/', u'http://localhost:8081/dashboardmodelview/list/', u'http://localhost:8081/slicemodelview/list/', u'http://localhost:8081/tablemodelview/list/', u'http://localhost:8081/dashboardmodelview/list/']

@bkyryliuk
Copy link
Member Author

bkyryliuk commented Sep 29, 2016

Looks like session history works across tabs:

[u'http://localhost:8081/slicemodelview/list/', u'http://localhost:8081/dashboardmodelview/list/', u'http://localhost:8081/dashboardmodelview/edit/99', u'http://localhost:8081/slicemodelview/list/', u'http://localhost:8081/slicemodelview/edit/119']

I opened the dashboardmodelview/list and then dashboardmodelview/edit/XX on one tab and then opened slicemodelview/list and slicemodelview/edit/XX on another and moved back to the tab with dashboardmodelview/edit.
Saving the dashboardmodelview/edit. redirects to the slicemodelview/list

@bkyryliuk
Copy link
Member Author

PR: dpgaspar/Flask-AppBuilder#381

@bkyryliuk bkyryliuk added this to the Los Cabos Sprint 2016-10-03 milestone Oct 3, 2016
@bkyryliuk
Copy link
Member Author

blocked on the flask review

zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

No branches or pull requests

1 participant