Skip to content

Commit

Permalink
Added new request logging
Browse files Browse the repository at this point in the history
  • Loading branch information
OdinsPlasmaRifle committed Jan 22, 2020
1 parent f1f84f4 commit af6f7cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drf_request_logging/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def finalize_response(self, request, response, *args, **kwargs):
# Update the "updated" date on the request.
self.old_request.save()
elif self.new_request:
# Recheck if a user was set (for auth requests).
user = request.user if not request.user.is_anonymous else None
# Add new information about the request.
self.new_request.user = user
self.new_request.status_code = response.status_code
# TODO : Look into saving this as rendered data/text.
# Pickle messes with the deepcopy functionality on models.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import find_packages, setup


VERSION = '0.0.1'
VERSION = '0.0.2'

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
Expand Down

0 comments on commit af6f7cb

Please sign in to comment.