don't save sessions for 404's

errors
eric 2019-08-01 19:40:23 -04:00
parent 9e116d4b20
commit 6943b60c0a
2 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,11 @@ CHERRYPY_CONFIG = os.path.join(install_dir, 'CherryPy.conf')
LOCAL_CONFIG = [os.path.expanduser('~/.autocat3'), '/etc/autocat3.conf'] LOCAL_CONFIG = [os.path.expanduser('~/.autocat3'), '/etc/autocat3.conf']
def error_page_404(status, message, traceback, version): def error_page_404(status, message, traceback, version):
return ErrorPage(status, message).index() resp = ErrorPage(status, message).index()
# signal that we needn't save the session
cherrypy.session.loaded = False
return resp
class MyRoutesDispatcher(cherrypy.dispatch.RoutesDispatcher): class MyRoutesDispatcher(cherrypy.dispatch.RoutesDispatcher):

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*- coding: utf-8 -*- # -*- mode: python; indent-tabs-mode: nil; -*- coding: utf-8 -*-
import cherrypy
from BaseSearcher import OpenSearch from BaseSearcher import OpenSearch
from Page import Page from Page import Page
import Formatters import Formatters