omab/django-social-auth — pull request #426 by estebistec (2012-08-03 05:17:30+00:00)
Title: Generalize duplicate uid error handling between the Django ORM and mongoengine models

They way IntegrityError is handled now doesn't cover mongoengine's behavior when constraints are violated. That is accounted for here. I tested both Django ORM and mongoengine models.

Also, there were cases when comparing uid didn't work so the social-auth object wasn't found, another was attempted to be created and a duplicate key error occurs. Fixed this by always converting it to str. RDBMS's will cast values to the target type to normalize, MongoDB will store exactly what you give it, so the python code needs to normalize it like this.