mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-15 15:30:16 +02:00
Added check to ensure api is valid before pulling characters
This commit is contained in:
parent
450f577860
commit
6bbea6eeda
@ -24,7 +24,8 @@ class UpdateKeyForm(forms.Form):
|
||||
if EveManager.check_if_api_key_pair_exist(self.cleaned_data['api_id']):
|
||||
logger.debug("UpdateKeyForm failed cleaning as API id %s already exists." % self.cleaned_data['api_id'])
|
||||
raise forms.ValidationError(u'API key already exist')
|
||||
|
||||
if EveApiManager.api_key_is_valid(self.cleaned_data['api_id'], self.cleaned_data['api_key']) is False:
|
||||
raise forms.ValidationError(u'API key is invalid')
|
||||
chars = EveApiManager.get_characters_from_api(self.cleaned_data['api_id'], self.cleaned_data['api_key']).result
|
||||
states = []
|
||||
states.append(self.user_state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user