Commit c698dbaf by Owo Sugiana

Bug fixed db lost connection

1 parent 5385b05b
......@@ -17,6 +17,7 @@ from pyramid.renderers import JSON
from pyramid_mailer import mailer_factory_from_settings
import datetime, decimal
from sqlalchemy import engine_from_config, or_
import transaction
from .security import (
group_finder,
get_user, MySecurityPolicy,
......@@ -167,6 +168,7 @@ def get_params(params, alternate=None, settings=None):
result = settings and params in settings and \
settings[params].strip() or None
if not result:
with transaction.manager:
row = Parameter.query_kode(params).first()
result = row and row.value or None
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!