Skip to content

Commit

Permalink
Bugfix: CRUDEvent signal error log try/except (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
jheld authored Apr 1, 2020
1 parent d772175 commit 3cdc719
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions easyaudit/signals/model_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ def crud_flow():
'user_pk_as_string': str(user.pk) if user else user
})
except Exception as e:
logger.exception(
"easy audit had a pre-save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
try:
logger.exception(
"easy audit had a pre_save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
except Exception:
pass
if getattr(settings, "TEST", False):
crud_flow()
else:
Expand Down Expand Up @@ -175,9 +178,12 @@ def crud_flow():
'user_pk_as_string': str(user.pk) if user else user
})
except Exception as e:
logger.exception(
"easy audit had a pre-save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
try:
logger.exception(
"easy audit had a post_save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
except Exception:
pass
if getattr(settings, "TEST", False):
crud_flow()
else:
Expand Down Expand Up @@ -258,9 +264,12 @@ def crud_flow():
'user_pk_as_string': str(user.pk) if user else user
})
except Exception as e:
logger.exception(
"easy audit had a pre-save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
try:
logger.exception(
"easy audit had a m2m_changed exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
except Exception:
pass

if getattr(settings, "TEST", False):
crud_flow()
Expand Down Expand Up @@ -307,9 +316,12 @@ def crud_flow():
})

except Exception as e:
logger.exception(
"easy audit had a pre-save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
try:
logger.exception(
"easy audit had a post_delete exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
instance, instance.pk))
except Exception:
pass

if getattr(settings, "TEST", False):
crud_flow()
Expand Down

0 comments on commit 3cdc719

Please sign in to comment.