Commit massif sur l'intranet
darcs-hash:20070602131029-c992d-820d228ff611f44b2a1fcb185633a65d865baad2.gz
This commit is contained in:
parent
1917896510
commit
5d71550f6b
6 changed files with 44 additions and 15 deletions
|
@ -143,9 +143,9 @@ class Intranet:
|
|||
|
||||
def send_error_repport(self, **kw):
|
||||
|
||||
# on récupère tout de suite le traceback
|
||||
# on recupere tout de suite le traceback
|
||||
tb = crans.utils.exceptions.formatExc()
|
||||
# entêtes du mail
|
||||
# entetes du mail
|
||||
exp = "intranet"
|
||||
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
||||
subject = "Rapport de Bug"
|
||||
|
@ -181,7 +181,7 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
text += "\n= Traceback =\n"
|
||||
text += tb
|
||||
|
||||
#on signe, quand même !
|
||||
#on signe, quand meme !
|
||||
text += "\n-- \nRoot.py pour l'intranet\n"
|
||||
|
||||
quickSend(exp, dest, subject, text)
|
||||
|
@ -199,7 +199,10 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
test.exposed = True
|
||||
|
||||
def _cp_on_http_error(self, status, message):
|
||||
if (cherrypy.config.configMap["global"]["server.environment"] == "development") or 1:
|
||||
if cherrypy.config.configMap["global"]["server.environment"] == "development":
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
return
|
||||
if cherrypy.config.configMap["global"]["displayBacktrace"] == "True":
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
return
|
||||
if status==403:
|
||||
|
@ -216,7 +219,7 @@ Ceci est un rapport de bug envoye par l'intranet.
|
|||
}
|
||||
elif status==500:
|
||||
self.send_error_repport(status = status, message = message )
|
||||
# les filtres ne sont pas appliqués, on le fait àla main...
|
||||
# les filtres ne sont pas appliques a la main...
|
||||
from TemplatesManager import TemplatesFilter
|
||||
TemplatesFilter().goWithThisDict({'template':'error', 'values':{'status':status, 'message':message }})
|
||||
else:
|
||||
|
|
|
@ -100,7 +100,8 @@ class TemplatesFilter(BaseFilter):
|
|||
body = self._useMainTemplate(body)
|
||||
else:
|
||||
body = body["page"]
|
||||
cherrypy.response.body = body.encode("utf8")
|
||||
body.encode("utf8")
|
||||
cherrypy.response.body = body
|
||||
|
||||
|
||||
def beforeFinalize(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue