Beispiel #1
0
def cluster_note_transaction_link(sender, instance, action, **kwargs):
    if action not in ("post_add", "post_remove", "post_clear"):
        return

    if type(instance) == Transaction:
        ClusterUpdate.perform(transaction_ids=set([instance.id]))
    elif type(instance) == Ticket:
        ClusterUpdate.perform(ticket_ids=set([instance.id]))
Beispiel #2
0
 def save(self, *args, **kwargs):
     cluster_update_only = kwargs.pop('cluster_update_only', False)
     if not cluster_update_only:
         self.updated = datetime.datetime.now()
     
     if self.event_date != None:
         self.sort_date = self.event_date
     elif self.created != None:
         self.sort_date = self.created.date()
     else:
         self.sort_date = datetime.date.today()
     
     super(Ticket, self).save(*args, **kwargs)
     
     if not cluster_update_only:
         ClusterUpdate.perform(ticket_ids=set([self.id]))
Beispiel #3
0
def flush_ticket_after_ack_delete(sender, instance, **kwargs):
    instance.ticket.flush_cache()
    ClusterUpdate.perform(ticket_ids=set([instance.ticket.id]))
Beispiel #4
0
def flush_ticket_after_ack_save(sender, instance, created, raw, **kwargs):
    if not raw:
        instance.ticket.flush_cache()
        ClusterUpdate.perform(ticket_ids=set([instance.ticket.id]))
Beispiel #5
0
 def save(self, *args, **kwargs):
     cluster_update_only = kwargs.pop("cluster_update_only", False)
     super(Transaction, self).save(*args, **kwargs)
     if not cluster_update_only:
         ClusterUpdate.perform(transaction_ids=set([self.id]))
Beispiel #6
0
 def save(self, *args, **kwargs):
     cluster_update_only = kwargs.pop("cluster_update_only", False)
     super(Expediture, self).save(*args, **kwargs)
     if not cluster_update_only and self.ticket.id != None:
         ClusterUpdate.perform(ticket_ids=set([self.ticket.id]))
 def forwards(self, orm):
     from tracker.clusters import ClusterUpdate
     ClusterUpdate.refresh_all()