|
|
|
@ -1,3 +1,4 @@
@@ -1,3 +1,4 @@
|
|
|
|
|
from pyramid.httpexceptions import HTTPFound |
|
|
|
|
from pyramid.view import view_config |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -7,6 +8,18 @@ from pyramid.view import view_config
@@ -7,6 +8,18 @@ from pyramid.view import view_config
|
|
|
|
|
renderer='ordr:templates/pages/welcome.jinja2', |
|
|
|
|
) |
|
|
|
|
def welcome(context, request): |
|
|
|
|
next = 'orders' if request.user else 'login' |
|
|
|
|
redirect_to = request.resource_url(context, next) |
|
|
|
|
return HTTPFound(redirect_to) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@view_config( |
|
|
|
|
context='ordr.resources.RootResource', |
|
|
|
|
name='login', |
|
|
|
|
permission='view', |
|
|
|
|
renderer='ordr:templates/pages/welcome.jinja2', |
|
|
|
|
) |
|
|
|
|
def login(context, request): |
|
|
|
|
return {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|