Fix - Init session
This commit is contained in:
commit
8da034885e
|
@ -96,10 +96,7 @@ class AppValues(object):
|
||||||
def on_get(self, req, resp, table):
|
def on_get(self, req, resp, table):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
if not 'userobj' in session:
|
# ~ print ('\n\nVALUES', session)
|
||||||
session.delete()
|
|
||||||
resp.status = falcon.HTTP_200
|
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
|
||||||
|
|
||||||
if table == 'admin':
|
if table == 'admin':
|
||||||
req.context['result'] = session['userobj'].es_superusuario \
|
req.context['result'] = session['userobj'].es_superusuario \
|
||||||
|
@ -111,10 +108,6 @@ class AppValues(object):
|
||||||
def on_delete(self, req, resp, table):
|
def on_delete(self, req, resp, table):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
if not 'userobj' in session:
|
|
||||||
session.delete()
|
|
||||||
resp.status = falcon.HTTP_200
|
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
|
||||||
|
|
||||||
if table == 'usuario' and (session['userobj'].id == int(values['id'])):
|
if table == 'usuario' and (session['userobj'].id == int(values['id'])):
|
||||||
resp.status = falcon.HTTP_204
|
resp.status = falcon.HTTP_204
|
||||||
|
@ -255,11 +248,6 @@ class AppInvoices(object):
|
||||||
def on_post(self, req, resp):
|
def on_post(self, req, resp):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
if not 'userobj' in session:
|
|
||||||
session.delete()
|
|
||||||
resp.status = falcon.HTTP_200
|
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
|
||||||
|
|
||||||
req.context['result'] = self._db.invoice(values, session['userobj'])
|
req.context['result'] = self._db.invoice(values, session['userobj'])
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
@ -307,11 +295,6 @@ class AppTickets(object):
|
||||||
def on_post(self, req, resp):
|
def on_post(self, req, resp):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
if not 'userobj' in session:
|
|
||||||
session.delete()
|
|
||||||
resp.status = falcon.HTTP_200
|
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
|
||||||
|
|
||||||
req.context['result'] = self._db.tickets(values, session['userobj'])
|
req.context['result'] = self._db.tickets(values, session['userobj'])
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
|
@ -70,11 +70,6 @@ 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']
|
||||||
if not 'userobj' in session:
|
|
||||||
session.delete()
|
|
||||||
resp.status = falcon.HTTP_200
|
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
|
||||||
|
|
||||||
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