roverdotcom/django-followit — pull request #1 by geekofalltrades (2014-08-15 22:39:32+00:00)
Title: [DEV-1400] Hack followit to get it following AskbotUsers.

This is a super-hacky edit of followit to get it following AskbotUser objects without having to change any Askbot code.

The issue was that followit patches methods onto User that are dynamically named, but then Askbot refers to hard-coded versions of the same names. When followit is told to follow User, it adds methods called "get_followed_users," "follow_user," and "unfollow_user" to auth User. If it's given AskbotUser instead, then the methods are called "get_followed_askbotusers"... etc, and Askbot expects the methods to be named the old way.

Ideally, followit would be removed completely in favor of a ManyToManyField on AskbotUser, possibly with a 'through' model. But for some reason, removing followit was causing problems. Even when followit isn't listed in INSTALLED_APPS, askbot loads it directly from the environment. When it's not in INSTALLED_APPS, but in the environment, then trying to delete an AskbotUser raises a DatabaseError. If it's not in INSTALLED_APPS AND not in the environment, then trying to CREATE an AskbotUser raises a DatabaseError. Uuuugggllyyyyy.

This issue was blocking DEV-1411 (backfilling AskbotUsers for existing Users) because `AskbotUser.objects.get_or_create` was misbehaving.