def _process_args(self): self._with_kpi = request.args.get('withKPI', type=bool) self._actionSucceeded = request.args.get('actionSucceeded', default=False, type=bool) location_name = request.view_args.get('locationId') self._location = Location.find_one(name=location_name)
def __init__(self, db_name, logger): self.db_name = db_name self._logger = logger try: self._location = Location.find_one(name='CERN') except NoResultFound: self._logger.exception("Synchronization failed: Location CERN not found in Indico DB") raise
def _checkParams(self): try: location = Location.find_one(name=self._params['location']) except NoResultFound: raise ServiceError( 'ERR-RB0', 'Invalid location name: {0}.'.format(self._params['location'])) self._rooms = sorted(location.rooms, key=lambda r: natural_sort_key(r.full_name))
def _process_args(self): name = request.view_args.get('locationId') self._location = Location.find_one(name=name) self._new_attr = None attr_title = request.form.get('newCustomAttributeName', default='').strip() if attr_title: attr_name = attr_title.replace(' ', '-').lower() if RoomAttribute.query.filter_by(name=attr_name).first(): raise BadRequest(_('There is already an attribute named: {0}').format(attr_name)) self._new_attr = RoomAttribute(name=attr_name, title=attr_title, is_hidden=request.form.get('newCustomAttributeIsHidden') == 'on')
def _process_args(self): self._eq = request.form.get(self.PARAM) name = request.view_args.get('locationId') self._location = Location.find_one(name=name)
def _process_args(self): name = request.view_args.get('locationId') self._location = Location.find_one(name=name) self._attr = request.args.get('removeCustomAttributeName', '')
def _checkParams(self): try: location = Location.find_one(name=self._params['location']) except NoResultFound: raise ServiceError('ERR-RB0', 'Invalid location name: {0}.'.format(self._params['location'])) self._rooms = sorted(location.rooms, key=lambda r: natural_sort_key(r.full_name))
def _process_args(self): self._with_kpi = request.args.get('withKPI', type=bool) self._actionSucceeded = request.args.get('actionSucceeded', default=False, type=bool) location_name = request.view_args.get('locationId') self._location = Location.find_one(name=location_name)
def _process_args(self): self._eq = request.form.get(self.PARAM) name = request.view_args.get('locationId') self._location = Location.find_one(name=name)
def _process_args(self): name = request.view_args.get('locationId') self._location = Location.find_one(name=name) self._attr = request.args.get('removeCustomAttributeName', '')