muhuk/django-simple-friends — pull request #40 by abbottc (2014-01-15 09:46:56+00:00)
Title: Patches Issue #39 and imports url utils in a manner compatible with Django 1.6

This patch modifies the post_syncdb_handler to only create Friendship and UserBlock instances for users if they don't already exist, which corrects the IntegrityError that would otherwise be raised. The patch also modifies urls.py because the location of the common url utils was changed in Django 1.4, and the old locations were deprecated in 1.6 (the patch looks in both places).

Note that the patched post_syncdb_handler no longer creates the entries in bulk, since an IntegrityError on any single record would roll back the entire transaction.

I've ran the test suite successfully with this patch in Django 1.6 and 1.3, and I've also applied the patch successfully in a current Django 1.6 project I'm currently developing.

One thing to note is that manage.py changed significantly in Django 1.4 and the old manage.py is deprecated in 1.6. This means that the current files in the "examples" folder don't work with 1.6, and therefore that folder's manage.py file can't be used to run the test suite under that version. Instead, to test with Django 1.6, a new project needs to be created, and the tests run from there.