1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-10 01:17:59 +03:00

Merge remote-tracking branch 'origin/v2.2'

# Conflicts:
#	server/src/uds/REST/methods/op_calendars.py
This commit is contained in:
Adolfo Gómez García 2019-01-18 08:34:47 +01:00
commit 2bd4f3d8e5
2 changed files with 13 additions and 7 deletions

View File

@ -130,14 +130,14 @@ class ActionsCalendars(DetailHandler):
@staticmethod
def as_dict(item):
action = CALENDAR_ACTION_DICT[item.action]
action = CALENDAR_ACTION_DICT.get(item.action, {})
params = json.loads(item.params)
return {
'id': item.uuid,
'calendarId': item.calendar.uuid,
'calendar': item.calendar.name,
'action': item.action,
'actionDescription': action['description'],
'actionDescription': action.get('description'),
'atStart': item.at_start,
'eventsOffset': item.events_offset,
'params': params,
@ -176,6 +176,8 @@ class ActionsCalendars(DetailHandler):
calendar = Calendar.objects.get(uuid=processUuid(self._params['calendarId']))
action = self._params['action'].upper()
if action not in CALENDAR_ACTION_DICT:
self.invalidRequestException()
eventsOffset = int(self._params['eventsOffset'])
atStart = self._params['atStart'] not in ('false', False, '0', 0)
params = json.dumps(self._params['params'])

View File

@ -100,7 +100,7 @@ class ServicesPools(ModelHandler):
# Field from where to get "class" and prefix for that class, so this will generate "row-state-A, row-state-X, ....
table_row_style = {'field': 'state', 'prefix': 'row-state-'}
custom_methods = [('setFallbackAccess', True), ('actionsList', True)]
custom_methods = [('setFallbackAccess', True), ('getFallbackAccess', True), ('actionsList', True)]
def item_as_dict(self, item):
summary = 'summarize' in self._params
@ -425,10 +425,14 @@ class ServicesPools(ModelHandler):
self.ensureAccess(item, permissions.PERMISSION_MANAGEMENT)
fallback = self._params.get('fallbackAccess')
logger.debug('Setting fallback of {} to {}'.format(item.name, fallback))
item.fallbackAccess = fallback
item.save()
return ''
if fallback != '':
logger.debug('Setting fallback of {} to {}'.format(item.name, fallback))
item.fallbackAccess = fallback
item.save()
return item.fallbackAccess
def getFallbackAccess(self, item):
return item.fallbackAccess
# Returns the action list based on current element, for calendar
def actionsList(self, item):