Skip to content

Commit

Permalink
Merge pull request #37 from JanMalte/patch-1
Browse files Browse the repository at this point in the history
add process_exception to prevent wrong attached requests after exception
  • Loading branch information
vvangelovski committed May 30, 2016
2 parents c168ef2 + 842dfdd commit 303175a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions audit_log/middleware.py
Expand Up @@ -45,6 +45,12 @@ def process_response(self, request, response):
signals.post_save.disconnect(dispatch_uid = (self.__class__, request,))
return response

def process_exception(self, request, exception):
if settings.DISABLE_AUDIT_LOG:
return None
signals.pre_save.disconnect(dispatch_uid = (self.__class__, request,))
signals.post_save.disconnect(dispatch_uid = (self.__class__, request,))
return None

def _update_pre_save_info(self, user, session, sender, instance, **kwargs):
registry = registration.FieldRegistry(fields.LastUserField)
Expand Down

0 comments on commit 303175a

Please sign in to comment.