mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-25 23:21:41 +03:00
Fixed comms for non suporting coms user services
This commit is contained in:
parent
d9a948df38
commit
f01d4302cf
@ -184,6 +184,7 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods
|
||||
raise self.invalidItemException()
|
||||
except IntegrityError: # Duplicate key probably
|
||||
if service and service.token:
|
||||
service.delete()
|
||||
raise RequestError(_('Service token seems to be in use by other service. Please, select a new one.'))
|
||||
raise RequestError(_('Element already exists (duplicate key error)'))
|
||||
except services.Service.ValidationException as e:
|
||||
|
@ -126,16 +126,25 @@ def sendScript(userService: 'UserService', script: str, forUser: bool = False) -
|
||||
"""
|
||||
If allowed, send script to user service
|
||||
"""
|
||||
_requestActor(userService, 'script', data={'script': script, 'user': forUser}, minVersion='3.0.0')
|
||||
try:
|
||||
_requestActor(userService, 'script', data={'script': script, 'user': forUser}, minVersion='3.0.0')
|
||||
except NoActorComms:
|
||||
pass
|
||||
|
||||
def requestLogoff(userService: 'UserService') -> None:
|
||||
"""
|
||||
Ask client to logoff user
|
||||
"""
|
||||
_requestActor(userService, 'logout', data={})
|
||||
try:
|
||||
_requestActor(userService, 'logout', data={})
|
||||
except NoActorComms:
|
||||
pass
|
||||
|
||||
def sendMessage(userService: 'UserService', message: str) -> None:
|
||||
"""
|
||||
Sends an screen message to client
|
||||
"""
|
||||
_requestActor(userService, 'message', data={'message':message})
|
||||
try:
|
||||
_requestActor(userService, 'message', data={'message':message})
|
||||
except NoActorComms:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user