Skip to content

Commit

Permalink
Merge branch 'feature/44-show-content-size' of github.com:maykinmedia…
Browse files Browse the repository at this point in the history
…/django-log-outgoing-requests into feature/44-show-content-size
  • Loading branch information
danielmursa-dev committed Nov 8, 2024
2 parents 76db859 + d453a96 commit cd3d202
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions log_outgoing_requests/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class OutgoingRequestsLogAdmin(admin.ModelAdmin):
"method",
"response_ms",
"timestamp",
"response_content_length",
)
list_filter = ("method", "timestamp", "status_code", "hostname")
search_fields = ("url", "params", "hostname")
Expand Down Expand Up @@ -57,6 +58,7 @@ class OutgoingRequestsLogAdmin(admin.ModelAdmin):
"res_headers",
"res_content_type",
"res_body_encoding",
"response_content_length",
"response_body",
)
},
Expand All @@ -76,6 +78,7 @@ class OutgoingRequestsLogAdmin(admin.ModelAdmin):
"response_ms",
"res_headers",
"res_content_type",
"response_content_length",
"response_body",
"trace",
)
Expand All @@ -100,6 +103,10 @@ def request_body(self, obj) -> str:
def response_body(self, obj) -> str:
return obj.response_body_decoded or "-"

@admin.display(description=_("Response content length"))
def response_content_length(self, obj):
return obj.response_content_length

def truncated_url(self, obj):
parsed_url = urlparse(obj.url)
path = parsed_url.path
Expand Down

0 comments on commit cd3d202

Please sign in to comment.