(instance, **kwargs)
| 9 | |
| 10 | @receiver(post_save, sender=LogEntry) |
| 11 | def publish_event(instance, **kwargs): |
| 12 | event = { |
| 13 | "model": instance.content_type.name, |
| 14 | "object": instance.object_repr, |
| 15 | "message": instance.get_change_message(), |
| 16 | "timestamp": instance.action_time.isoformat(), |
| 17 | "user": str(instance.user), |
| 18 | "content_type_id": instance.content_type_id, |
| 19 | "object_id": instance.object_id, |
| 20 | } |
| 21 | connection = get_redis_connection("default") |
| 22 | payload = json.dumps(event) |
| 23 | connection.publish("events", payload) |
nothing calls this directly
no test coverage detected
searching dependent graphs…