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():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
Original file line number Diff line number Diff line change 1
1
import flask
2
2
3
+ import pypi_org .infrastructure .cookie_auth as cookie_auth
3
4
from pypi_org .infrastructure .view_modifiers import response
4
5
from pypi_org .services import user_service
5
- import pypi_org .infrastructure .cookie_auth as cookie_auth
6
6
from pypi_org .viewmodels .account .index_viewmodel import IndexViewModel
7
7
from pypi_org .viewmodels .account .login_viewmodel import LoginViewModel
8
8
from pypi_org .viewmodels .account .register_viewmodel import RegisterViewModel
@@ -58,6 +58,11 @@ def register_post():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def register_post():
58
58
@response (template_file = 'account/login.html' )
59
59
def login_get ():
60
60
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
+
61
66
return vm .to_dict ()
62
67
63
68
You can’t perform that action at this time.
0 commit comments