Skip to content

Commit 2b89731

Browse files
authored
Merge pull request #82 from MindscapeHQ/fix-setRequestDetails-chaining
Add missing return self in set_request_details builder
2 parents 16d2e7a + 37d2662 commit 2b89731

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.2.2 (23/01/2019):
2+
Bugfixes
3+
- Fix `set_request_details` builder method not returning self causing it to be unchainable
4+
15
## 4.2.1 (18/12/2018):
26
Bugfixes
37
- Set version correctly in crash report sent to Raygun API ([#78](https://github.com/MindscapeHQ/raygun4py/pull/79))

python2/raygun4py/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# 1) we don't load dependencies by storing it in __init__.py
33
# 2) we can import it in setup.py for the same reason
44
# 3) we can import it into your module module
5-
__version__ = '4.2.1'
5+
__version__ = '4.2.2'

python3/raygun4py/raygunmsgs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def set_request_details(self, request):
9797
rg_request_details = http_utilities.build_wsgi_compliant_request(request)
9898
self.raygunMessage.details['request'] = rg_request_details
9999

100+
return self
101+
100102

101103
def set_version(self, version):
102104
self.raygunMessage.details['version'] = version

python3/raygun4py/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# 1) we don't load dependencies by storing it in __init__.py
33
# 2) we can import it in setup.py for the same reason
44
# 3) we can import it into your module module
5-
__version__ = '4.2.1'
5+
__version__ = '4.2.2'

python3/tests/test_raygunmsgs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ def test_wsgi_standard_header_names(self):
109109
self.assertEqual(self.builder.raygunMessage.details['request']['headers']['Referer'],
110110
"https://www.google.com/")
111111

112+
def test_set_request_details_allows_chaining(self):
113+
self.builder \
114+
.set_request_details(self.raw_wsgi_request) \
115+
.set_tags(['foo', 'bar'])
116+
117+
112118
class TestRaygunErrorMessage(unittest.TestCase):
113119
class GrandchildError(Exception):
114120
pass

0 commit comments

Comments
 (0)