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
Assumption that user.id is an int, but this breaks when using django-nonrel #103
Comments
Depending on an integer primary key is going to cover 80% (most likely more than 80%) of the cases. I don't want to exclude the 20% entirely. I think the best way forward is to allow you to customize this behavior. Do you have any suggestions on how you will handle encoding the ID data for future retrieval? |
I'd just like to add that I'm now being affected by this issue, using MongoDB/mongoengine with Django authentication. I'm not sure what your question is asking, brosner. The ID data is coming from the primary key of the mongodb table, which is going to look like "_id" : ObjectId("52ec2cefb0e1464a8b37529a") When Django gets this back, it's stripped of the ObjectId wrapper and becomes just "52ec2cefb0e1464a8b37529a", which is clearly not an int. This bug is a showstopper for me, and I'm really not sure where to go from here. |
Figured I should follow up - in the end, I went back and installed all of the updated packages, and altered the libraries I was using, and thus managed to get it all working. If you get this error, you're probably doing "something wrong". Key Settings for my project:
and in views, I use:
If you need a working example, you can always check out my repository to see what I've done. |
djangouser-accounts seems to work very well with django-nonrel (a version of django that works with non-relational database such as monogdb), except I noticed when trying to wire up the forgot-password, an exception is thrown (see below)
This seems like a straightforward fix. The reason it breaks is because in non-relational databases, the PK is not guranteed to be an int. In fact, it's usually more of a guid that is a combination of letters and characters.
File "/home/person/testenv2/local/lib/python2.7/site-packages/account/views.py", line 515, in send_email
uid = int_to_base36(user.id)
File "/home/person/testenv2/local/lib/python2.7/site-packages/django/utils/http.py", line 188, in int_to_base36
raise TypeError("Non-integer base36 conversion input.")
The text was updated successfully, but these errors were encountered: