Skip to content
Permalink
80df834e8b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
16 lines (13 sloc) 441 Bytes
"""
Django backend that uses the RemoteUserBackend as a base
class and that sets the email field on the user model
to be the same as the username field each time a new
user is created.
"""
from django.contrib.auth.backends import RemoteUserBackend
class MailHeaderBackend(RemoteUserBackend):
def configure_user(self, user):
username = user.get_username()
user.email = username;
user.save()
return user