From 14eceb353ca675ef453706b48a2120583030f150 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 5 Mar 2012 01:28:58 +0000 Subject: [PATCH] Store the primary character name as the firstname --- django-testauth/auth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django-testauth/auth.py b/django-testauth/auth.py index 755f39e..47d87f5 100644 --- a/django-testauth/auth.py +++ b/django-testauth/auth.py @@ -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: