mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-15 15:22:17 +00:00
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:
@@ -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']):
|
||||
|
||||
Reference in New Issue
Block a user