From 94dc88b86d3946f2047d4795ac713a456b40cd79 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 11 Sep 2010 19:31:53 +0100 Subject: [PATCH] Convert roleID to int to save hassle --- eve_api/api_puller/accounts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eve_api/api_puller/accounts.py b/eve_api/api_puller/accounts.py index f7b46b7..49629a4 100755 --- a/eve_api/api_puller/accounts.py +++ b/eve_api/api_puller/accounts.py @@ -172,10 +172,11 @@ def import_eve_character(api_key, user_id, character_id): # Process the character's roles pchar.director = False + pchar.roles.clear() roles = values.get('corporationRoles', None) if roles and len(roles): for r in roles: - role, created = EVEPlayerCharacterRole.objects.get_or_create(id=r['roleID'], name=r['roleName']) + role, created = EVEPlayerCharacterRole.objects.get_or_create(id=int(r['roleID']), name=r['roleName']) pchar.roles.add(role) if r['roleName'] == 'roleDirector': pchar.director = True