diff --git a/server/src/uds/core/managers/UserServiceManager.py b/server/src/uds/core/managers/UserServiceManager.py index 76cfd5b3..a132e25c 100644 --- a/server/src/uds/core/managers/UserServiceManager.py +++ b/server/src/uds/core/managers/UserServiceManager.py @@ -343,8 +343,7 @@ class UserServiceManager(object): with transaction.atomic(): dsp.cachedDeployedService.filter(state__in=State.INFO_STATES).delete() - def getAssignationForUser(self, ds, user): - # First, we try to locate an already assigned service + def getExistingAssignationForUser(self, ds, user): existing = ds.assignedUserServices().filter(user=user, state__in=State.VALID_STATES) lenExisting = existing.count() if lenExisting > 0: # Already has 1 assigned @@ -355,6 +354,13 @@ class UserServiceManager(object): # return existing[1] # else: # return existing[0] + return None + + def getAssignationForUser(self, ds, user): + assignedUserService = self.getExistingAssignationForUser(ds, user) + # If has an assigend user service, returns this without any more work + if assignedUserService is not None: + return assignedUserService # Now try to locate 1 from cache already "ready" (must be usable and at level 1) with transaction.atomic(): diff --git a/server/src/uds/models/UserService.py b/server/src/uds/models/UserService.py index 54cc2deb..15ad633d 100644 --- a/server/src/uds/models/UserService.py +++ b/server/src/uds/models/UserService.py @@ -35,7 +35,7 @@ from __future__ import unicode_literals -__updated__ = '2015-01-26' +__updated__ = '2015-01-28' from django.db import models from django.db.models import signals diff --git a/server/src/uds/templates/uds/html5/index.html b/server/src/uds/templates/uds/html5/index.html index e6db4b52..8acb56e1 100644 --- a/server/src/uds/templates/uds/html5/index.html +++ b/server/src/uds/templates/uds/html5/index.html @@ -9,7 +9,12 @@ {% if ser.transports %}
{% with trans=ser.transports|first numTransports=ser.transports|length %} -
@@ -31,7 +36,7 @@