Store the primary character name as the firstname

This commit is contained in:
2012-03-05 01:28:58 +00:00
parent 79e967cc6f
commit 14eceb353c

View File

@@ -29,15 +29,20 @@ class TESTAuthBackend:
if 'auth' in obj and obj['auth'] == 'ok':
email = obj['email']
groups = obj['groups']
name = None
if obj.has_key('primarycharacter'):
name = obj['primarycharacter']['name']
valid = True
if valid:
user, created = User.objects.get_or_create(username=username.lower())
if created:
user.set_unusable_password() # disable login through Model backend
user.save()
if email:
user.email = email
if name
user.first_name = name
user.save()
if getattr(settings, 'TEST_AUTH_CREATE_GROUPS', False):
for g in groups: