Fix - Fields in send mail
This commit is contained in:
parent
5259fe9c80
commit
8ef8fdb714
|
@ -1311,7 +1311,12 @@ def make_fields(xml):
|
||||||
|
|
||||||
|
|
||||||
def make_info_mail(data, fields):
|
def make_info_mail(data, fields):
|
||||||
|
try:
|
||||||
return data.format(**fields).replace('\n', '<br/>')
|
return data.format(**fields).replace('\n', '<br/>')
|
||||||
|
except:
|
||||||
|
log.error(data)
|
||||||
|
log.error(fields)
|
||||||
|
return data.replace('\n', '<br/>')
|
||||||
|
|
||||||
|
|
||||||
def send_mail(data):
|
def send_mail(data):
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AuthMiddleware(object):
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
user = session.get('userobj', None)
|
user = session.get('userobj', None)
|
||||||
id_session = req.cookies.get('beaker.session.id', '')
|
id_session = req.cookies.get('beaker.session.id', '')
|
||||||
# ~ print ('\n\n', id_session, session, '\n\n')
|
print ('\n\n', id_session, session, '\n\n')
|
||||||
if req.path == '/empresas' or req.path == '/values/empresas':
|
if req.path == '/empresas' or req.path == '/values/empresas':
|
||||||
if MV:
|
if MV:
|
||||||
pass
|
pass
|
||||||
|
@ -71,6 +71,7 @@ class ConnectionMiddleware(object):
|
||||||
def process_resource(self, req, resp, resource, params):
|
def process_resource(self, req, resp, resource, params):
|
||||||
id_session = req.cookies.get('beaker.session.id', '')
|
id_session = req.cookies.get('beaker.session.id', '')
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
|
print ('\n\n', id_session, session, '\n\n')
|
||||||
rfc = session.get('rfc', '')
|
rfc = session.get('rfc', '')
|
||||||
if id_session and rfc:
|
if id_session and rfc:
|
||||||
opt = util.get_con(rfc)
|
opt = util.get_con(rfc)
|
||||||
|
|
Loading…
Reference in New Issue