Merge branch 'esi' of https://github.com/r4stl1n/allianceauth into multitenant

This commit is contained in:
Adarnof
2016-12-20 06:54:40 +00:00
39 changed files with 1357 additions and 1295 deletions

View File

@@ -319,7 +319,6 @@ class EveApiManager:
def validate_api(api_id, api_key, user):
try:
info = EveApiManager.get_api_info(api_id, api_key).result
chars = EveApiManager.get_characters_from_api(api_id, api_key).result
except evelink.api.APIError as e:
if int(e.code) == 222:
raise EveApiManager.ApiInvalidError(api_id)
@@ -329,6 +328,7 @@ class EveApiManager:
auth, c = AuthServicesInfo.objects.get_or_create(user=user)
states = [auth.state]
from authentication.tasks import determine_membership_by_character # circular import issue
chars = info['characters']
for char in chars:
evechar = EveCharacter()
evechar.character_name = chars[char]['name']

View File

@@ -1,25 +0,0 @@
from __future__ import unicode_literals
import requests
import json
class EveWhoManager:
def __init__(self):
pass
@staticmethod
def get_corporation_members(corpid):
url = "http://evewho.com/api.php?type=corplist&id=%s" % corpid
jsondata = requests.get(url).content
data = json.loads(jsondata.decode())
members = {}
page_count = 0
while len(data["characters"]):
for row in data["characters"]:
members[int(row["character_id"])] = {"name": row["name"], "id": int(row["character_id"])}
page_count += 1
jsondata = requests.get(url + "&page=%i" % page_count).content
data = json.loads(jsondata.decode())
return members