diff --git a/mrq/monkey.py b/mrq/monkey.py index b203863a..f60f5213 100644 --- a/mrq/monkey.py +++ b/mrq/monkey.py @@ -410,7 +410,7 @@ def _Cursor__send_message(self, *args, **kwargs): config.get("mongodb_pre_hook")({ "collection": full_name, "method": subtype, - "args": (args[0].spec, ), + "args": (getattr(args[0], "spec", None), ), "kwargs": kwargs, "client": self._Cursor__collection.database.client, "job": job @@ -429,7 +429,7 @@ def _Cursor__send_message(self, *args, **kwargs): config.get("mongodb_post_hook")({ "collection": full_name, "method": subtype, - "args": (args[0].spec, ), + "args": (getattr(args[0], "spec", None), ), "kwargs": kwargs, "client": self._Cursor__collection.database.client, "job": job,