Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Moesif/moesifdjango
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilling committed Feb 3, 2018
2 parents b8d512f + 10a4bb3 commit 19b8542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions moesifdjango/middleware_pre19.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ def __init__(self):

def process_request(self, request):
request.moesif_req_time = timezone.now()
request._body = request.body

def process_response(self, request, response):
# Code to be executed for each request before
# the view (and later middleware) are called.

req_time = request.moesif_req_time
raw_request_body = copy.copy(request.body)
raw_request_body = request._body

if self.DEBUG:
print("raw body before getting response" + raw_request_body)
Expand Down Expand Up @@ -180,7 +181,7 @@ def mapper(key):
if get_metadata is not None:
metadata = get_metadata(request, response)
except:
if DEBUG:
if self.DEBUG:
print("can not execute get_metadata function, please check moesif settings.")


Expand All @@ -202,7 +203,7 @@ def mapper(key):
event_model = EventModel(request=event_req,
response=event_rsp,
user_id=username,
session_token=session_token
session_token=session_token,
metadata=metadata)

try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.2.2',
version='1.2.3',

description='Moesif Middleware for Python Django',
long_description=long_description,
Expand Down

0 comments on commit 19b8542

Please sign in to comment.