Fixed service launcher & metapool launcher to correctly recognize http urls

This commit is contained in:
Adolfo Gómez García 2020-09-23 14:07:05 +02:00
parent 9d6fd8a1ab
commit a2aef2fba0
4 changed files with 19 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ import typing
from django.utils.translation import ugettext
from django.utils import formats
from django.urls.base import reverse
from django.urls import reverse
from uds.models import ServicePool, Transport, Network, ServicePoolGroup, MetaPool, getSqlDatetime
from uds.core.util.config import GlobalConfig

View File

@ -33,6 +33,7 @@ import logging
import typing
from django.utils.translation import ugettext as _
from django.urls import reverse
from django.http import HttpResponse
from django.views.decorators.cache import cache_page, never_cache
@ -126,6 +127,13 @@ def userServiceEnabler(request: 'HttpRequest', idService: str, idTransport: str)
userService, trans = res[1], res[3]
typeTrans = trans.getType()
error = '' # No error
if typeTrans.ownLink:
url = reverse('TransportOwnLink', args=('A' + userService.uuid, trans.uuid))
else:
data = {
'service': 'A' + userService.uuid,
'transport': trans.uuid,
@ -134,7 +142,6 @@ def userServiceEnabler(request: 'HttpRequest', idService: str, idTransport: str)
}
ticket = TicketStore.create(data)
error = ''
url = html.udsLink(request, ticket, scrambler)
except ServiceNotReadyError as e:
logger.debug('Service not ready')