minor fix

This commit is contained in:
Wilson Gomez 2023-02-03 12:08:00 -05:00
parent 58c042fa3d
commit ecfd5187e1
2 changed files with 6 additions and 4 deletions

View File

@ -26,7 +26,7 @@ from app.commons.config import Params
# from ..version import __version__
from app.commons.ui_login import Ui_Login
# from app.css.flat_button_small import *
context = ssl._create_unverified_context()
context_http = ssl._create_unverified_context()
_ = gettext.gettext
@ -249,7 +249,7 @@ def xconnection(mode, user, password, host, database, port):
if mode == 'http':
conn = HTTPConnection(host, port=port, timeout=10)
else:
conn = HTTPSConnection(host, port=port, timeout=10, context=context)
conn = HTTPSConnection(host, port=port, timeout=10, context=context_http)
url = '/' + database + '/login'
payload = {
'method': "common.db.login",

View File

@ -17,7 +17,7 @@ try:
from app.commons.common import slugify, file_open
except:
from commons.common import slugify, file_open
context = ssl._create_unverified_context()
from app.commons.dblogin import context_http
HEADERS = {
@ -51,8 +51,10 @@ class Model(object):
# self.api = 'http://localhost:8010/ZIRUS'
if ctx['params']['mode'] == 'http':
self.conn = HTTPConnection
self.context_http = None
else:
self.conn = HTTPSConnection
self.context_http = context_http
enviroment = ctx['params']['enviroment']
if enviroment == 'retail':
@ -217,7 +219,7 @@ class Report(object):
self.context_http = None
else:
self.conn = HTTPSConnection
self.context_http = context
self.context_http = context_http
def get_connection(self, method, target, data=None):
url = '/' + self.db + target