forked from shaba/openuds
Fixed service launcher & metapool launcher to correctly recognize http urls
This commit is contained in:
parent
9d6fd8a1ab
commit
a2aef2fba0
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -33,7 +33,7 @@ import typing
|
|||||||
|
|
||||||
from django.utils.translation import ugettext
|
from django.utils.translation import ugettext
|
||||||
from django.utils import formats
|
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.models import ServicePool, Transport, Network, ServicePoolGroup, MetaPool, getSqlDatetime
|
||||||
from uds.core.util.config import GlobalConfig
|
from uds.core.util.config import GlobalConfig
|
||||||
|
@ -33,6 +33,7 @@ import logging
|
|||||||
import typing
|
import typing
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
from django.urls import reverse
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.views.decorators.cache import cache_page, never_cache
|
from django.views.decorators.cache import cache_page, never_cache
|
||||||
|
|
||||||
@ -126,16 +127,22 @@ def userServiceEnabler(request: 'HttpRequest', idService: str, idTransport: str)
|
|||||||
|
|
||||||
userService, trans = res[1], res[3]
|
userService, trans = res[1], res[3]
|
||||||
|
|
||||||
data = {
|
typeTrans = trans.getType()
|
||||||
'service': 'A' + userService.uuid,
|
|
||||||
'transport': trans.uuid,
|
|
||||||
'user': request.user.uuid,
|
|
||||||
'password': password
|
|
||||||
}
|
|
||||||
|
|
||||||
ticket = TicketStore.create(data)
|
error = '' # No error
|
||||||
error = ''
|
|
||||||
url = html.udsLink(request, ticket, scrambler)
|
if typeTrans.ownLink:
|
||||||
|
url = reverse('TransportOwnLink', args=('A' + userService.uuid, trans.uuid))
|
||||||
|
else:
|
||||||
|
data = {
|
||||||
|
'service': 'A' + userService.uuid,
|
||||||
|
'transport': trans.uuid,
|
||||||
|
'user': request.user.uuid,
|
||||||
|
'password': password
|
||||||
|
}
|
||||||
|
|
||||||
|
ticket = TicketStore.create(data)
|
||||||
|
url = html.udsLink(request, ticket, scrambler)
|
||||||
except ServiceNotReadyError as e:
|
except ServiceNotReadyError as e:
|
||||||
logger.debug('Service not ready')
|
logger.debug('Service not ready')
|
||||||
# Not ready, show message and return to this page in a while
|
# Not ready, show message and return to this page in a while
|
||||||
|
Loading…
Reference in New Issue
Block a user