From 317fa3b51dfbad4cc092a8c6c19e85e064edd9ae Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 20 Sep 2020 12:46:52 -0700 Subject: [PATCH] Call assert_not_deleted before every @transaction. --- etiquette/decorators.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etiquette/decorators.py b/etiquette/decorators.py index c0ae60e..1c3ff30 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -75,6 +75,9 @@ def transaction(method): ''' @functools.wraps(method) def wrapped_transaction(self, *args, **kwargs): + if isinstance(self, objects.ObjectBase): + self.assert_not_deleted() + photodb = _get_relevant_photodb(self) commit = kwargs.pop('commit', False)