New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert user_id to str if UUID used as PK #45
Conversation
Fix for py-ampq FrameSyntaxError during serialization in Celery
Convert user_id to str if UUID used as PK
Codecov Report
@@ Coverage Diff @@
## master #45 +/- ##
===========================================
- Coverage 100.00% 99.90% -0.10%
===========================================
Files 40 40
Lines 1080 1083 +3
===========================================
+ Hits 1080 1082 +2
- Misses 0 1 +1
Continue to review full report at Codecov.
|
I believe you could just use this signal to do this: >>> from django.dispatch import receiver
>>> from django_structlog.celery import signals
>>>
>>> @receiver(signals.modify_context_before_task_publish)
... def receiver_modify_context_before_task_publish(sender, signal, context):
... if "user_id" in context and context["user_id"]:
... context["user_id"] = str(context["user_id"]) |
I created the issue #46 to find a more generic solution. Thank you @fadedDexofan for this proposition. |
@fadedDexofan could you show me how to reproduce the problem using the demo project? |
This PR finally fixes #51 I noticed while trying to reproduce your problem. |
@fadedDexofan in 1.6.2 there is your fix so you might want to upgrade and remove the workaround I gave you. |
Fix for py-ampq FrameSyntaxError during serialization in Celery