fixed the case of missing tickets and a typo in last commit
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.00.1 (2012-08-28 21:11:21) rc4
|
||||
Version 2.00.1 (2012-08-28 22:14:54) rc4
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
'These files are not served, they are only available from within your app': 'These files are not served, they are only available from within your app',
|
||||
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
||||
'Ticket ID': 'Ticket ID',
|
||||
'Ticket Missing': 'Ticket Missing',
|
||||
'To create a plugin, name a file/folder plugin_[name]': 'To create a plugin, name a file/folder plugin_[name]',
|
||||
'Traceback': 'Traceback',
|
||||
'Translation strings for the application': 'Translation strings for the application',
|
||||
|
||||
@@ -13,12 +13,16 @@
|
||||
<th>web2py™</th>
|
||||
<td>{{=myversion}}</td>
|
||||
</tr>
|
||||
{{if snapshot:}}
|
||||
<tr>
|
||||
<th>Python</th>
|
||||
<td>{{=snapshot.get('pyver','')}}</td>
|
||||
</tr>
|
||||
{{pass}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{if traceback or code or layer:}}
|
||||
<h3>{{=T('Traceback')}}</h3>
|
||||
<div class="inspect">
|
||||
{{=traceback}}
|
||||
@@ -130,4 +134,6 @@
|
||||
<h3>In file: {{=layer}}</h3>
|
||||
{{=CODE(code.replace('\r',''),language='python',link='/examples/global/vars/')}}
|
||||
</div>
|
||||
|
||||
{{else:}}
|
||||
<h3>{{=T('Ticket Missing')}}</h3>
|
||||
{{pass}}
|
||||
|
||||
+4
-4
@@ -90,7 +90,7 @@ from dal import BaseAdapter
|
||||
from settings import global_settings
|
||||
from validators import CRYPT
|
||||
from cache import Cache
|
||||
from html import URL as Url, xmlescape
|
||||
from html import URL, xmlescape
|
||||
from utils import is_valid_ip_address
|
||||
from rewrite import load, url_in, thread as rwthread, try_rewrite_on_error
|
||||
import newcron
|
||||
@@ -442,10 +442,10 @@ def wsgibase(environ, responder):
|
||||
if not exists(request.folder):
|
||||
if app == rwthread.routes.default_application \
|
||||
and app != 'welcome':
|
||||
redirect(Url(app,'default','index'))
|
||||
redirect(URL('welcome','default','index'))
|
||||
elif rwthread.routes.error_handler:
|
||||
_handler = rwthread.routes.error_handler
|
||||
redirect(Url(_handler['application'],
|
||||
redirect(URL(_handler['application'],
|
||||
_handler['controller'],
|
||||
_handler['function'],
|
||||
args=app))
|
||||
@@ -456,7 +456,7 @@ def wsgibase(environ, responder):
|
||||
elif not request.is_local and \
|
||||
exists(pjoin(request.folder,'DISABLED')):
|
||||
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
||||
request.url = Url(r=request,
|
||||
request.url = URL(r=request,
|
||||
args=request.args,
|
||||
extension=request.raw_extension)
|
||||
|
||||
|
||||
+13
-10
@@ -88,16 +88,19 @@ class TicketStorage(Storage):
|
||||
ticket_id,
|
||||
):
|
||||
if not self.db:
|
||||
ef = self._error_file(request, ticket_id, 'rb', app)
|
||||
try:
|
||||
ef = self._error_file(request, ticket_id, 'rb', app)
|
||||
except IOError:
|
||||
return {}
|
||||
try:
|
||||
return cPickle.load(ef)
|
||||
finally:
|
||||
ef.close()
|
||||
table = self._get_table(self.db, self.tablename, app)
|
||||
rows = self.db(table.ticket_id == ticket_id).select()
|
||||
if rows:
|
||||
return cPickle.loads(rows[0].ticket_data)
|
||||
return None
|
||||
else:
|
||||
table = self._get_table(self.db, self.tablename, app)
|
||||
rows = self.db(table.ticket_id == ticket_id).select()
|
||||
return cPickle.loads(rows[0].ticket_data) if rows else {}
|
||||
|
||||
|
||||
|
||||
class RestrictedError(Exception):
|
||||
@@ -164,10 +167,10 @@ class RestrictedError(Exception):
|
||||
ticket_storage = TicketStorage(db=request.tickets_db)
|
||||
d = ticket_storage.load(request, app, ticket_id)
|
||||
|
||||
self.layer = d['layer']
|
||||
self.code = d['code']
|
||||
self.output = d['output']
|
||||
self.traceback = d['traceback']
|
||||
self.layer = d.get('layer')
|
||||
self.code = d.get('code')
|
||||
self.output = d.get('output')
|
||||
self.traceback = d.get('traceback')
|
||||
self.snapshot = d.get('snapshot')
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user