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)
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
def notify(self, action, message, user): e = Event(content_object=self, action=action) e.description = message e.triggered_by = user e.save()