-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Subscription object is not JSON serializable #104
Comments
Hey there, Thanks for the feedback. It seems that there are no comma’s in your CSV, is that right? Mathijs On 17 mrt. 2014 08:01:36, amureki [email protected] wrote: Greetings. csv file: — |
Yep, i place emails like this:
Where should I place commas, after every email in the same cell? |
Perhaps you might want to give me a link to the actual file. For more info on CSV: https://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules_and_examples |
Seems like I wrongly understood about csv format first time, but now after adding commas: |
Hmm. Could you give me a traceback (from DEBUG mode) and/or a screenshot? |
Sure, here is screenshot of some traceback info: Error rising after I choose newsletter and CSV from above and press "Upload". |
Yup same here...any news? |
Allow me a while to get back to this. I’m at a conference now. |
Absolutely. In the meanwhile I am having fun reading the code... :-) |
Good! Don’t hesitate with obvious improvements. :) |
Any updates here? Would be great to have a reproducible test case so the issue can be fixed. |
Hi, i had this error too. This is due to the change in Django 1.6 session_serializer. Look here https://docs.djangoproject.com/en/1.6/ref/settings/#session-serializer |
Hey @RaidoS, Thanks for the workaround. I'll have to find some time to actually solve the issue (unless someone else gets to it before me - pull req's are welcome) - but now at least your solution is in the bug report on top. M |
Hi I'm using Django 1.8.1 and I got the same problem, solved the same way. BTW: I'm using django-newsletter with cuttlefish.io as a backend to send emails and track clicks and responses, it seems to be working. |
This is a pretty serious bug and it would be great to be able to solve this before the 0.6 release. Steps:
|
Since Django 1.6 the default session serializer uses JSON objects instead of pickle objects to circumvent potential security issues. However, the import mechanism of django-newsletter stores subscription objects which are not JSON-serializable.
Exception
http://monosnap.com/image/OWikyTx9p7xURpTwhLNEt86M5rAnYK.png
And traceback gist: https://gist.github.com/amureki/9613750
Error rising after I choose newsletter and CSV from above and press "Upload".
Workaround
This is due to the change in Django 1.6 session_serializer. Look here https://docs.djangoproject.com/en/1.6/ref/settings/#session-serializer
So, if you have Django > 1.6 and django-newsletter current version, simplest way — you should add into your settings file:
Solution
The solution would be to rewrite the import mechanism to store just the raw imported data in the session and create the subcription objects right before saving. Pull requests are much welcomed!
The text was updated successfully, but these errors were encountered: