Example #1
0
    def notify(self, action, message, user):
        """
        Notifies this order of an event
        This is also the hub for automation handling
        """
        if self.is_closed:
            return

        e = Event(content_object=self, action=action)
        e.description = message
        e.triggered_by = user
        e.save()

        for f in self.followed_by.exclude(pk=user.pk).exclude(should_notify=False):
            e.notify_users.add(f)

        if action == "product_arrived":
            if self.queue and self.queue.status_products_received:
                new_status = self.queue.status_products_received
                self.set_status(new_status, user)
Example #2
0
    def notify(self, action, message, user):
        """
        Notifies this order of an event
        This is also the hub for automation handling
        """
        if self.is_closed:
            return

        e = Event(content_object=self, action=action)
        e.description = message
        e.triggered_by = user
        e.save()

        for f in self.followed_by.exclude(pk=user.pk).exclude(should_notify=False):
            e.notify_users.add(f)

        if action == "product_arrived":
            if self.queue and self.queue.status_products_received:
                new_status = self.queue.status_products_received
                self.set_status(new_status, user)

        return e
Example #3
0
File: note.py Project: filipp/Servo
 def notify(self, action, message, user):
     e = Event(content_object=self, action=action)
     e.description = message
     e.triggered_by = user
     e.save()
Example #4
0
 def notify(self, action, message, user):
     e = Event(content_object=self, action=action)
     e.description = message
     e.triggered_by = user
     e.save()