File tree Expand file tree Collapse file tree 6 files changed +31
-1
lines changed Expand file tree Collapse file tree 6 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
Original file line number Diff line number Diff line change 11import flask
22
3+ import pypi_org .infrastructure .cookie_auth as cookie_auth
34from pypi_org .infrastructure .view_modifiers import response
45from pypi_org .services import user_service
5- import pypi_org .infrastructure .cookie_auth as cookie_auth
66from pypi_org .viewmodels .account .index_viewmodel import IndexViewModel
77from pypi_org .viewmodels .account .login_viewmodel import LoginViewModel
88from pypi_org .viewmodels .account .register_viewmodel import RegisterViewModel
@@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
5858@response (template_file = 'account/login.html' )
5959def login_get ():
6060 vm = LoginViewModel ()
61+
62+ # Added after recording, see https://github.com/talkpython/data-driven-web-apps-with-flask/issues/24
63+ if vm .user_id :
64+ return flask .redirect ('/account' )
65+
6166 return vm .to_dict ()
6267
6368
You can’t perform that action at this time.
0 commit comments