fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
e20ef31ff7
commit
1b01df79e2
9 changed files with 312 additions and 144 deletions
|
|
@ -42,19 +42,23 @@ class WuttaContinuumConfigExtension(WuttaConfigExtension):
|
|||
This adds a startup hook, which can optionally turn on the
|
||||
SQLAlchemy-Continuum versioning features for the main app DB.
|
||||
"""
|
||||
key = 'wutta_continuum'
|
||||
|
||||
key = "wutta_continuum"
|
||||
|
||||
def startup(self, config):
|
||||
""" """
|
||||
# only do this if config enables it
|
||||
if not config.get_bool('wutta_continuum.enable_versioning',
|
||||
usedb=False, default=False):
|
||||
if not config.get_bool(
|
||||
"wutta_continuum.enable_versioning", usedb=False, default=False
|
||||
):
|
||||
return
|
||||
|
||||
# create wutta plugin, to assign user and ip address
|
||||
spec = config.get('wutta_continuum.wutta_plugin_spec',
|
||||
usedb=False,
|
||||
default='wutta_continuum.conf:WuttaContinuumPlugin')
|
||||
spec = config.get(
|
||||
"wutta_continuum.wutta_plugin_spec",
|
||||
usedb=False,
|
||||
default="wutta_continuum.conf:WuttaContinuumPlugin",
|
||||
)
|
||||
WuttaPlugin = load_object(spec)
|
||||
|
||||
# tell sqlalchemy-continuum to do its thing
|
||||
|
|
@ -109,10 +113,10 @@ class WuttaContinuumPlugin(Plugin):
|
|||
|
||||
remote_addr = self.get_remote_addr(uow, session)
|
||||
if remote_addr:
|
||||
kwargs['remote_addr'] = remote_addr
|
||||
kwargs["remote_addr"] = remote_addr
|
||||
|
||||
user_id = self.get_user_id(uow, session)
|
||||
if user_id:
|
||||
kwargs['user_id'] = user_id
|
||||
kwargs["user_id"] = user_id
|
||||
|
||||
return kwargs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue