1
|
import quixote
|
2
|
from quixote.errors import *
|
3
|
|
4
|
import template
|
5
|
|
6
|
class AccessUnauthorizedError(AccessError):
|
7
|
def render [html] (self):
|
8
|
session = quixote.get_session()
|
9
|
request = quixote.get_request()
|
10
|
session.after_url = request.get_url()
|
11
|
login_url = request.environ['SCRIPT_NAME'] + '/login'
|
12
|
quixote.redirect(login_url)
|
13
|
|
14
|
class AccessForbiddenError(AccessError):
|
15
|
def render [html] (self):
|
16
|
return template.error_page(_('Access Forbidden'))
|
17
|
|
18
|
class EmailError(Exception):
|
19
|
pass
|
20
|
|
21
|
TraversalError.title = N_('Page not found')
|
22
|
TraversalError.description = N_(
|
23
|
"The requested link does not exist on this site. If "
|
24
|
"you arrived here by following a link from an external "
|
25
|
"page, please inform that page's maintainer.")
|
26
|
|
27
|
|
28
|
def format_publish_error [html] (exc):
|
29
|
return template.error_page(_(exc.description), _(exc.title))
|
30
|
|