1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixing up things

This commit is contained in:
Adolfo Gómez García 2016-04-26 15:13:54 +02:00
parent 4fb863cfa7
commit 50bc3cd3ef
4 changed files with 14 additions and 10 deletions

View File

@ -39,7 +39,7 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__updated__ = '2016-03-09' __updated__ = '2016-04-25'
class ServiceProvider(Module): class ServiceProvider(Module):
@ -178,14 +178,16 @@ class ServiceProvider(Module):
if val is None: if val is None:
val = self.maxPreparingServices = GlobalConfig.MAX_PREPARING_SERVICES.getInt(force=True) # Recover global an cache till restart val = self.maxPreparingServices = GlobalConfig.MAX_PREPARING_SERVICES.getInt(force=True) # Recover global an cache till restart
return int(getattr(val, 'value', val)) retVal = int(getattr(val, 'value', val))
return retVal if retVal > 0 else 1
def getMaxRemovingServices(self): def getMaxRemovingServices(self):
val = self.maxRemovingServices val = self.maxRemovingServices
if val is None: if val is None:
val = self.maxRemovingServices = GlobalConfig.MAX_REMOVING_SERVICES.getInt(force=True) # Recover global an cache till restart val = self.maxRemovingServices = GlobalConfig.MAX_REMOVING_SERVICES.getInt(force=True) # Recover global an cache till restart
return int(getattr(val, 'value', val)) retVal = int(getattr(val, 'value', val))
return retVal if retVal > 0 else 1
def getIgnoreLimits(self): def getIgnoreLimits(self):
val = self.ignoreLimits val = self.ignoreLimits

View File

@ -55,7 +55,7 @@ from uds.models.Util import getSqlDatetime
import logging import logging
__updated__ = '2016-02-26' __updated__ = '2016-04-26'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -310,8 +310,9 @@ class UserService(UUIDModel):
save: Defaults to true. If false, record will not be saved to db, just modified save: Defaults to true. If false, record will not be saved to db, just modified
''' '''
self.state_date = getSqlDatetime() if state != self.state:
self.state = state self.state_date = getSqlDatetime()
self.state = state
def setOsState(self, state): def setOsState(self, state):
''' '''
@ -323,8 +324,9 @@ class UserService(UUIDModel):
save: Defaults to true. If false, record will not be saved to db, just modified save: Defaults to true. If false, record will not be saved to db, just modified
''' '''
self.state_date = getSqlDatetime() if state != self.os_state:
self.os_state = state self.state_date = getSqlDatetime()
self.os_state = state
def assignToUser(self, user): def assignToUser(self, user):
''' '''

View File

@ -350,7 +350,7 @@ gui.servicesPools.link = (event) ->
onData: (data) -> onData: (data) ->
$.each data, (undefined_, value) -> $.each data, (undefined_, value) ->
value.group_name = gui.fastLink(value.auth_name, "#{value.auth_id},g#{value.id}", 'gui.servicesPools.fastLink', 'goAuthLink') value.group_name = gui.fastLink("#{value.auth_name}\\#{value.name}", "#{value.auth_id},g#{value.id}", 'gui.servicesPools.fastLink', 'goAuthLink')
return return
return return

View File

@ -62,7 +62,7 @@
required: f.gui.required required: f.gui.required
tooltip: f.gui.tooltip tooltip: f.gui.tooltip
type: f.gui.type type: f.gui.type
name: f.name name: f.name + (if editing is "readonly" then '__' else '')
css: "modal_field_data" css: "modal_field_data"
) )