fusionbox/django-fusionbox — pull request #33 by colinta (2012-04-17 17:46:52+00:00)
Title: Email as username

This is based on some bug reports from Paula.

Modifies `fix_user/models.py` to create more user-friendly forms. The downside is that this is some pretty heavy monkey-patching. The upside is that Paula will not buggy your admin/user forms ;-)

Here's the overview:

1. Renames `username.label` to "Email", and I updated the `help_text` to say "Must be a valid email".
2. Modifies the `email` field to be readonly and disabled, and gives it the label "Username", and added `help_text` to explain the situation to the user.
3. Added a signal to set `user.email` to `user.username` in `pre_save`. So even if the *do* send an email address, it will be ignored.

The reason the labels are swapped: django validates uniqueness on the `username` field, not the `email` field. So it is more straightforward to have the user set the `username`, and just blindly assign that to the `email`. But it *looks better* if the user thinks they are doing the opposite.

So there you have it.