mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-05 09:17:54 +03:00
small fix on REST (visual)
This commit is contained in:
parent
a3dd038e79
commit
07c304cecb
@ -78,7 +78,7 @@ class Dispatcher(View):
|
|||||||
content_type = None
|
content_type = None
|
||||||
|
|
||||||
cls = None
|
cls = None
|
||||||
while len(path) > 0:
|
while path:
|
||||||
# .json, .xml, ... will break path recursion
|
# .json, .xml, ... will break path recursion
|
||||||
if path[0].find('.') != -1:
|
if path[0].find('.') != -1:
|
||||||
content_type = path[0].split('.')[1]
|
content_type = path[0].split('.')[1]
|
||||||
@ -92,7 +92,7 @@ class Dispatcher(View):
|
|||||||
break
|
break
|
||||||
|
|
||||||
full_path = '/'.join(full_path)
|
full_path = '/'.join(full_path)
|
||||||
logger.debug("REST request: {} ({})".format(full_path, content_type))
|
logger.debug('REST request: %s (%s)', full_path, content_type)
|
||||||
|
|
||||||
# Here, service points to the path
|
# Here, service points to the path
|
||||||
cls = service['']
|
cls = service['']
|
||||||
|
@ -191,12 +191,20 @@ def ticketAuth(request, ticketId):
|
|||||||
request.session['ticket'] = '1' # Store that user access is done using ticket
|
request.session['ticket'] = '1' # Store that user access is done using ticket
|
||||||
|
|
||||||
logger.debug("Service & transport: {}, {}".format(servicePool, transport))
|
logger.debug("Service & transport: {}, {}".format(servicePool, transport))
|
||||||
for v in DeployedService.objects.all():
|
# for v in DeployedService.objects.all():
|
||||||
logger.debug("{} {}".format(v.uuid, v.name))
|
# logger.debug("{} {}".format(v.uuid, v.name))
|
||||||
|
|
||||||
# Check if servicePool is part of the ticket
|
# Check if servicePool is part of the ticket
|
||||||
if servicePool is not None:
|
if servicePool is not None:
|
||||||
# If service pool is in there, also is transport
|
# If service pool is in there, also is transport
|
||||||
|
# Deferred update transport
|
||||||
|
servicePoolDb = DeployedService.objects.get(uuid=servicePool)
|
||||||
|
for t in servicePoolDb.transports.order_by('priority'):
|
||||||
|
typeTrans = t.getType()
|
||||||
|
if t.validForIp(request.ip) and typeTrans.supportsOs(request.os['OS']) and t.validForOs(request.os['OS']):
|
||||||
|
transport = t.uuid
|
||||||
|
break
|
||||||
|
|
||||||
res = userServiceManager().getService(request.user, request.ip, 'F' + servicePool, transport, False)
|
res = userServiceManager().getService(request.user, request.ip, 'F' + servicePool, transport, False)
|
||||||
_x, userService, _x, transport, _x = res
|
_x, userService, _x, transport, _x = res
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user