mail = EmailField(unique=True, null=False, blank=False)
member o user via ForeignKey
in member views, a field with "administrative mail" is view and modified separately and link to User.mail. On change, a check against UserMail.mail is made to ensure a mail is not inserted twice
in member views, additional mail table point to MemberMail mails and check on insertion if mail is present as User.mail or a UserMails.mail before accepting changes
in login via admin page nothing change, only username works
in login for members (view), POST request pass (username, password):
if username is a valid User.username => login(username, password)
if username is a valid User.mail => login(user.username, password)
if username is a valid UserMail.mail => login(umail.user.username, password)
NOTE: in the unfortunate event that a UserMail.mail coincide with a User.mail (maybe for some strage internal error or an admin oversight), User.mail will have always precedence over UserMail.mail with this setup
NOTE: in the unfortunate event that a UserMail.mail coincide with a User.mail (maybe for some strage internal error or an admin oversight), User.mail will have always precedence over UserMail.mail with this setup