Revision 7f26a756
Ajout de logs pour les actions "actives" (#639).
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@7047 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/root.py | ||
---|---|---|
60 | 60 |
from vigiboard.widgets.edit_event import edit_event_status_options, \ |
61 | 61 |
EditEventForm |
62 | 62 |
from vigiboard.widgets.search_form import create_search_form |
63 |
import logging |
|
64 |
|
|
65 |
LOGGER = logging.getLogger(__name__) |
|
63 | 66 |
|
64 | 67 |
__all__ = ('RootController', 'get_last_modification_timestamp', |
65 | 68 |
'date_to_timestamp') |
... | ... | |
567 | 570 |
timestamp=datetime.now(), |
568 | 571 |
) |
569 | 572 |
DBSession.add(history) |
573 |
LOGGER.info(_('User "%(user)s" (%(address)s) changed the ' |
|
574 |
'trouble ticket from "%(previous)s" to "%(new)s" ' |
|
575 |
'on event #%(idevent)d') % { |
|
576 |
'user': request.identity['repoze.who.userid'], |
|
577 |
'address': request.remote_addr, |
|
578 |
'previous': event.trouble_ticket, |
|
579 |
'new': trouble_ticket, |
|
580 |
'idevent': event.idcause, |
|
581 |
}) |
|
570 | 582 |
event.trouble_ticket = trouble_ticket |
571 | 583 |
|
572 | 584 |
# Changement du statut d'acquittement. |
... | ... | |
594 | 606 |
}) |
595 | 607 |
|
596 | 608 |
history = EventHistory( |
597 |
type_action="Forced change state", |
|
609 |
type_action=u"Forced change state",
|
|
598 | 610 |
idevent=event.idcause, |
599 | 611 |
value=u'OK', |
600 | 612 |
text="Forced state to 'OK'", |
... | ... | |
602 | 614 |
timestamp=datetime.now(), |
603 | 615 |
) |
604 | 616 |
DBSession.add(history) |
605 |
|
|
617 |
LOGGER.info(_('User "%(user)s" (%(address)s) forcefully ' |
|
618 |
'closed event #%(idevent)d') % { |
|
619 |
'user': request. \ |
|
620 |
identity['repoze.who.userid'], |
|
621 |
'address': request.remote_addr, |
|
622 |
'idevent': event.idcause, |
|
623 |
}) |
|
624 |
|
|
606 | 625 |
history = EventHistory( |
607 | 626 |
type_action=u"Acknowledgement change state", |
608 | 627 |
idevent=event.idcause, |
... | ... | |
615 | 634 |
timestamp=datetime.now(), |
616 | 635 |
) |
617 | 636 |
DBSession.add(history) |
637 |
LOGGER.info(_('User "%(user)s" (%(address)s) changed the state ' |
|
638 |
'from "%(previous)s" to "%(new)s" on event ' |
|
639 |
'#%(idevent)d') % { |
|
640 |
'user': request.identity['repoze.who.userid'], |
|
641 |
'address': request.remote_addr, |
|
642 |
'previous': event.status, |
|
643 |
'new': changed_ack, |
|
644 |
'idevent': event.idcause, |
|
645 |
}) |
|
618 | 646 |
event.status = changed_ack |
619 | 647 |
|
620 | 648 |
DBSession.flush() |
Also available in: Unified diff