Support for Incarna v1.1, Customizable API Keys

- Support CAK keys and their spinoffs
- Add support for the Employment History data available in CharacterInfo.xml.aspx
- Add a Gargoyle flag to disable backend processing when needed
- Clean up a few inconsistancies with how the models are handled
This commit is contained in:
2011-08-31 13:42:09 +01:00
parent eb4bf84c01
commit ad56058631
20 changed files with 811 additions and 121 deletions

View File

@@ -1,6 +1,8 @@
import re
from django import forms
from gargoyle import gargoyle
from eve_api.models import EVEAccount, EVEPlayerCharacter, EVEPlayerCorporation
@@ -20,9 +22,13 @@ class EveAPIForm(forms.ModelForm):
# We're editing a existing instance, readonly the userid
self.fields['api_user_id'].widget.attrs['readonly'] = True
if gargoyle.is_active('eve-cak'):
self.fields['api_user_id'].label = 'Key ID'
self.fields['api_key'].label = 'Verification Code'
def clean_api_key(self):
if not len(self.cleaned_data['api_key']) == 64:
if not gargoyle.is_active('eve-cak') and not len(self.cleaned_data['api_key']) == 64:
raise forms.ValidationError("Provided API Key is not 64 characters long.")
if re.search(r'[^\.a-zA-Z0-9]', self.cleaned_data['api_key']):