danfairs/django-lazysignup — pull request #14 by gert314 (2011-12-10 09:50:57+00:00)
Title: Improved handling of users without cookies

Hi Dan

Firstly excellent project, a simple non invasive add-on to any site!

Your USER_AGENT_BLACKLIST setting works for the well known search engines (that we know about and can add to the list) but I found a lot of "unknown" search engines and user agents with cookies disabled can really fill up your user table.

All we need to do is detect if the user agent accepts cookies and only then create the lazy user. Detection is normally a two step process but the session middleware already does the first step for us. We just need to check for the presence of the sessionid cookie. If its not there don't create the user.

The add-on is two lines in the decorator but is a huge plus.

Regards
Gert Steyn