Project

General

Profile

Revision 1bb369b9

ID1bb369b98b521eed5321abcbc1117ce5929940ef
Parent e9ccb711
Child 3ee2b81b

Added by Francois POIROTTE over 14 years ago

Correction d'un bug qui empêchait la consultation des données de l'historique.
Vérification un peu plus strict des valeurs transmises au RootController de Vigiboard (utilisation de validateurs).

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@1676 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/controllers/root.py
310 310
                    hist_error = True,
311 311
                    plugin_context = events.context_fct,
312 312
                    search = {
313
                        'host': None,
314
                        'service': None,
315
                        'output': None,
316
                        'tt': None,
317
                        'from_date': None,
318
                        'to_date': None,
319
                        'hostgroup': None,
320
                        'servicegroup': None,
313
                        'host': '',
314
                        'service': '',
315
                        'output': '',
316
                        'tt': '',
317
                        'from_date': '',
318
                        'to_date': '',
319
                        'hostgroup': '',
320
                        'servicegroup': '',
321 321
                    },
322 322
                   refresh_times=config['vigiboard_refresh_times'],
323 323
                )
......
372 372
                    hist_error = True,
373 373
                    plugin_context = events.context_fct,
374 374
                    search = {
375
                        'host': None,
376
                        'service': None,
377
                        'output': None,
378
                        'tt': None,
379
                        'from_date': None,
380
                        'to_date': None,
381
                        'hostgroup': None,
382
                        'servicegroup': None,
375
                        'host': '',
376
                        'service': '',
377
                        'output': '',
378
                        'tt': '',
379
                        'from_date': '',
380
                        'to_date': '',
381
                        'hostgroup': '',
382
                        'servicegroup': '',
383 383
                    },
384 384
                    refresh_times=config['vigiboard_refresh_times'],
385 385
                )
386 386

  
387 387
    @validate(validators={
388
        "id":validators.Regex(r'^[^,]+(,[^,]*)*,?$'),
389
#        "trouble_ticket":validators.Regex(r'^[0-9]*$'),
388
        "id": validators.Regex(r'^[0-9]+(,[0-9]+)*,?$'),
389
#        "trouble_ticket": validators.Regex(r'^[0-9]*$'),
390 390
        "status": validators.OneOf([
391
            'NoChange',
392
            'None',
393
            'Acknowledged',
394
            'AAClosed'
391
            u'NoChange',
392
            u'None',
393
            u'Acknowledged',
394
            u'AAClosed'
395 395
        ])}, error_handler=process_form_errors)
396 396
    @require(Any(not_anonymous(), msg=l_("You need to be authenticated")))
397 397
    def update(self,**krgv):
......
501 501
            return plug.controller(*arg, **krgv)
502 502
        except:
503 503
            raise
504
    
505
#    @validate(validators= {"fontsize": validators.Int()},
506
#                    error_handler = process_form_errors)
504

  
505
    @validate(validators={
506
        "fontsize": validators.Regex(
507
            r'[0-9]+(pt|px|em|%)',
508
            regexOps=('I',)
509
        )}, error_handler = process_form_errors)
507 510
    @expose('json')
508 511
    def set_fontsize(self, fontsize):
509 512
        """

Also available in: Unified diff