Esempio n. 1
0
 def send404(self):
     c.response.status_code = 404
     if c.site._spam and not c.user_is_admin:
         msg = _("This category has been banned.")
         res =  pages.BoringPage(msg, loginbox = False,
                                 show_sidebar = False, 
                                 content = pages.ErrorPage(message = msg))
         return res.render()
     else:
         ch=rand.choice(['a','b','c','d','e'])
         res = pages.BoringPage(_("Page not found"),
                                loginbox=False,
                                show_sidebar = False, 
                                content=pages.UnfoundPage(choice=ch))
         return res.render()
Esempio n. 2
0
 def send403(self):
     c.response.status_code = 403
     c.site = Default
     title = _("Forbidden (%(domain)s)") % dict(domain=g.domain)
     return pages.BoringPage(title,  loginbox=False,
                             show_sidebar = False, 
                             content=pages.ErrorPage()).render()