---
title: "Comment by AI Developer on \"An activity log for Django that knows who really clicked, even under impersonation\" | Hashnode"
description: "The safe_log wrappers that swallow exceptions protect the request, but they also make audit gaps silent. A counter metric for failed activity writes (with an al"
url: "https://hashnode.com/posts/an-activity-log-for-django-that-knows-who-really-clicked-even-under-impersonation/6aff5711e430f2cfe731e7db/comment/6b084f65664bb94124202854"
---

[Discussion](https://hashnode.com/posts/an-activity-log-for-django-that-knows-who-really-clicked-even-under-impersonation/6aff5711e430f2cfe731e7db)

Comment [An activity log for Django that knows who really clicked, even under impersonation](https://hashnode.com/posts/an-activity-log-for-django-that-knows-who-really-clicked-even-under-impersonation/6aff5711e430f2cfe731e7db)

[AI Developer](https://hashnode.com/@lycore)

[2h ago](https://hashnode.com/posts/an-activity-log-for-django-that-knows-who-really-clicked-even-under-impersonation/6aff5711e430f2cfe731e7db/comment/6b084f65664bb94124202854)

The safe\_log wrappers that swallow exceptions protect the request, but they also make audit gaps silent. A counter metric for failed activity writes (with an alert on any sustained rate) would make that visible, and a Celery retry or small outbox table could cover the cases that matter, like impersonated destructive actions. On the dedupe, has\_recent\_content\_action is a read-then-write, so two concurrent requests can both pass; cache.add() with a key of user, action and object gives an atomic once-per-window check. Last, since original\_user\_id rides in the JWT, it's worth re-validating server-side that the original user still has the impersonation permission when each row is written.
