Fix - Issue #42
This commit is contained in:
parent
480ec57d1e
commit
8f74d24b14
|
@ -2,6 +2,7 @@
|
|||
|
||||
import falcon
|
||||
from middleware import get_template
|
||||
from urllib.parse import unquote
|
||||
|
||||
|
||||
class AppEmpresas(object):
|
||||
|
@ -111,6 +112,14 @@ class AppValues(object):
|
|||
def on_get(self, req, resp, table):
|
||||
values = req.params
|
||||
session = req.env['beaker.session']
|
||||
|
||||
if table == 'product':
|
||||
original = values['name']
|
||||
try:
|
||||
values['name'] = unquote(req.query_string.split('=')[1])
|
||||
except Exception as e:
|
||||
values['name'] = original
|
||||
|
||||
if req.path in ('/values/titlelogin', '/values/empresas'):
|
||||
req.context['result'] = self._db.get_values(table, values, session)
|
||||
resp.status = falcon.HTTP_200
|
||||
|
@ -280,6 +289,7 @@ class AppProducts(object):
|
|||
def on_get(self, req, resp):
|
||||
values = req.params
|
||||
user = req.env['beaker.session']['userobj']
|
||||
|
||||
if 'opt' in values:
|
||||
req.context['result'] = self._db.products_get(values, user)
|
||||
else:
|
||||
|
|
|
@ -1097,22 +1097,6 @@ function search_product_by_key(key){
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
//~ webix.ajax().get('/values/productokey', {'key': key}, {
|
||||
//~ error: function(text, data, xhr) {
|
||||
//~ msg_error('Error al consultar')
|
||||
//~ },
|
||||
//~ success: function(text, data, xhr){
|
||||
//~ var values = data.json()
|
||||
//~ if (values.ok){
|
||||
//~ set_product(values)
|
||||
//~ } else {
|
||||
//~ msg = 'No se encontró un producto con la clave: ' + key
|
||||
//~ msg_error(msg)
|
||||
//~ }
|
||||
//~ }
|
||||
//~ })
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue