Changeset - fc3aa4d77297
[Not reviewed]
0 1 0
Lance Edgar (lance) - 17 months ago 2023-05-18 00:00:34
lance@edbob.org
Avoid lookup of continuum user for short session

at least by default..
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rattail/app.py
Show inline comments
 
@@ -36,6 +36,7 @@ import tempfile
 
import warnings
 
import logging
 
from collections import OrderedDict
 
from functools import partial
 

	
 
import humanize
 
from mako.template import Template
 
@@ -1194,7 +1195,13 @@ class AppHandler(object):
 

	
 
    def short_session(self, **kwargs):
 
        from rattail.db.util import short_session
 
        kwargs.setdefault('factory', self.make_session)
 

	
 
        if 'factory' not in kwargs:
 
            # nb. usually want to avoid continuum user lookup for
 
            # short session, but caller can override if needed
 
            kwargs['factory'] = partial(self.make_session,
 
                                        continuum_user=None)
 

	
 
        return short_session(**kwargs)
 

	
 
    def cache_model(self, session, model, **kwargs):
0 comments (0 inline, 0 general)