Skip to content

Commit e9eb284

Browse files
authored
Merge pull request #55 from feliphebueno/v3.0.1
Fixes issue with CallbackService being executed after the Response ob…
2 parents ebf9691 + f2a4cce commit e9eb284

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

rinzler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Main
33
"""
44
__name__ = "Rinzler REST Framework"
5-
__version__ = "3.0.0"
5+
__version__ = "3.0.1"
66
__author__ = ["Rinzler<github.com/feliphebueno>", "4ndr<github.com/4ndr>"]
77
__license__ = "MIT"
88

rinzler/core/router.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ def dispatch(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
7474
self.app.log.error("< 500", exc_info=True)
7575
response = Response(None, status=500)
7676
finally:
77-
response = (
78-
self.set_response_headers(response.render(indent))
79-
if isinstance(response, Response)
80-
else self.set_response_headers(response)
81-
)
82-
8377
self.call_response_callback(
8478
response=response,
8579
method=request.method,
@@ -93,6 +87,9 @@ def dispatch(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
9387
client_ips=self.get_client_ip(request.META),
9488
)
9589

90+
response_body = response.render(indent) if isinstance(response, Response) else response
91+
response = self.set_response_headers(response_body)
92+
9693
return response
9794

9895
def exec_route_callback(

rinzler/logger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
},
4040
"root": {
41-
"level": "INFO",
41+
"level": "INFO", # TODO: REDUCE TO DEBUG
4242
"handlers": [
4343
"console",
4444
"info_file_handler",

0 commit comments

Comments
 (0)