|
|
|
@ -1,13 +1,24 @@
@@ -1,13 +1,24 @@
|
|
|
|
|
from pyramid.response import Response |
|
|
|
|
from pyramid.httpexceptions import HTTPFound |
|
|
|
|
from pyramid.view import view_config |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@view_config( |
|
|
|
|
context='ordr2.resources.Root', |
|
|
|
|
permission='view' |
|
|
|
|
) |
|
|
|
|
def welcome(context, request): |
|
|
|
|
next = 'orders' if request.user else 'about' |
|
|
|
|
redirect_to = request.resource_url(context, next) |
|
|
|
|
return HTTPFound(redirect_to) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@view_config( |
|
|
|
|
context='ordr2.resources.Root', |
|
|
|
|
name='about', |
|
|
|
|
permission='view', |
|
|
|
|
renderer='ordr2:templates/pages/welcome.jinja2' |
|
|
|
|
) |
|
|
|
|
def welcome(context, request): |
|
|
|
|
def about(context, request): |
|
|
|
|
return {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|