fixed edit fields

This commit is contained in:
Adolfo Gómez García 2019-11-13 13:56:06 +01:00
parent eb2ad9da19
commit ee42653cea
4 changed files with 8 additions and 8 deletions

View File

@ -97,7 +97,6 @@ class IPMachineDeployed(services.UserDeployment, AutoAttributes):
logger.debug("Starting deploy of %s for user %s", self._ip, user)
return self.__deploy()
def assign(self, ip: str) -> str:
logger.debug('Assigning from assignable with ip %s', ip)
self._ip = ip

View File

@ -38,7 +38,6 @@ from django.utils.translation import ugettext_lazy as _
from uds.core.ui import gui
from uds.core.services import types as serviceTypes
from uds.core.util.state import State
from .deployment import IPMachineDeployed
from .service_base import IPServiceBase
@ -125,9 +124,11 @@ class IPMachinesService(IPServiceBase):
logger.exception("Exception at getUnassignedMachine")
def listAssignables(self):
return [(ip, ip.split('~')[0]) for ip in self._ips]
return [(ip, ip.split('~')[0]) for ip in self._ips if self.storage.readData(ip) is None]
def assignFromAssignables(self, assignableId: str, user: 'models.User', userDeployment: 'services.UserDeployment') -> str:
userServiceInstance = typing.cast(IPMachineDeployed, userDeployment)
return userServiceInstance.assign(assignableId)
userServiceInstance: IPMachineDeployed = typing.cast(IPMachineDeployed, userDeployment)
if self.storage.readData(assignableId) is None:
self.storage.saveData(assignableId, assignableId)
return userServiceInstance.assign(assignableId)
return userServiceInstance.error('IP already assigned')

File diff suppressed because one or more lines are too long

View File

@ -92,6 +92,6 @@
</svg>
</div>
</uds-root>
<script src="/uds/res/admin/runtime.js?stamp=1573474523" defer></script><script src="/uds/res/admin/polyfills-es5.js?stamp=1573474523" nomodule defer></script><script src="/uds/res/admin/polyfills.js?stamp=1573474523" defer></script><script src="/uds/res/admin/main.js?stamp=1573474523" defer></script></body>
<script src="/uds/res/admin/runtime.js?stamp=1573648531" defer></script><script src="/uds/res/admin/polyfills-es5.js?stamp=1573648531" nomodule defer></script><script src="/uds/res/admin/polyfills.js?stamp=1573648531" defer></script><script src="/uds/res/admin/main.js?stamp=1573648531" defer></script></body>
</html>