Skip to content

Commit

Permalink
Fixes Bogdanp#188: when using the PickleEncoder, fix task view by sho…
Browse files Browse the repository at this point in the history
…wing a representation of the args
  • Loading branch information
Huub Bouma committed Feb 25, 2025
1 parent 6542ebb commit b55b622
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions django_dramatiq/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def message_details(self, instance):
message_dict = instance.message._asdict()

# make sure we can still get a representation of the
# kwargs payload when a non json encoder is in use
kwargs_encoder = DjangoDramatiqConfig.select_encoder()
if not isinstance(kwargs_encoder, JSONEncoder):
# args + kwargs payload when a non json encoder is in use
dramatiq_encoder = DjangoDramatiqConfig.select_encoder()
if not isinstance(dramatiq_encoder, JSONEncoder):
for k, v in message_dict["args"].items():
message_dict["args"][k] = f"<{v}>"
for k, v in message_dict["kwargs"].items():
message_dict["kwargs"][k] = f"<{v}>"

Expand Down

0 comments on commit b55b622

Please sign in to comment.