envoi de rapports de bug...
darcs-hash:20061202214729-f46e9-87e28633677416742ceee22abab710b20dba7537.gz
This commit is contained in:
parent
1c05521bd2
commit
122619c021
3 changed files with 62 additions and 34 deletions
|
@ -65,7 +65,7 @@ cherrypy.config.update({'global':{'crans_ldap':crans_ldap()}})
|
|||
from plugins.domfilter import DOMFilter
|
||||
from plugins.templatesfilter import TemplatesFilter
|
||||
from plugins.verifdroitsfilter import VerifDroitsFilter
|
||||
|
||||
from crans.mail import quickSend
|
||||
# ######################################################## #
|
||||
# SERVER #
|
||||
# ######################################################## #
|
||||
|
@ -106,9 +106,31 @@ class Intranet:
|
|||
}
|
||||
info.exposed = True
|
||||
|
||||
def send_error_repport(self, **kw):
|
||||
exp = "intranet"
|
||||
dest = cherrypy.config.get("mail.bugreport", "nounous@crans.org")
|
||||
subject = "Rapport de Bug"
|
||||
text = """
|
||||
Bonsoir,
|
||||
|
||||
Ceci est un rapport de bug envoye depuis l'intranet.
|
||||
|
||||
%s
|
||||
""" % "\n".join( [ "%s: %s" % (str(a), str(kw[a])) for a in kw] )
|
||||
quickSend(exp, dest, subject, text)
|
||||
return self.index()
|
||||
|
||||
send_error_repport.exposed = True
|
||||
|
||||
def testErreur(self):
|
||||
raise Exception, "sdlfkjqmsdklj"
|
||||
|
||||
testErreur.exposed = True
|
||||
|
||||
def test(self):
|
||||
return cherrypy.request.remote_addr
|
||||
test.exposed = True
|
||||
|
||||
def _cp_on_http_error(self, status, message):
|
||||
if status==403:
|
||||
cherrypy.response.body = {
|
||||
|
@ -122,6 +144,9 @@ class Intranet:
|
|||
'values':{'status':status, 'message':message },
|
||||
'standalone':False,
|
||||
}
|
||||
elif status==500:
|
||||
from plugins.templatesfilter import TemplatesFilter
|
||||
TemplatesFilter().goWithThisDict({'template':'error', 'values':{'status':status, 'message':message }})
|
||||
else:
|
||||
cherrypy._cputil._cp_on_http_error(status, message)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue