mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 06:20:16 +02:00
commit
ebcefd0279
@ -529,7 +529,7 @@ def refresh_api(api_key_pair):
|
|||||||
logger.debug("API key %s has a new character on the account: %s" % (api_key_pair.api_id, characters.result[char]['name']))
|
logger.debug("API key %s has a new character on the account: %s" % (api_key_pair.api_id, characters.result[char]['name']))
|
||||||
if new_character:
|
if new_character:
|
||||||
logger.debug("Creating new character %s from api key %s" % (characters.result[char]['name'], api_key_pair.api_id))
|
logger.debug("Creating new character %s from api key %s" % (characters.result[char]['name'], api_key_pair.api_id))
|
||||||
EveManager.create_characters_from_list(characters, user, api_key_pair.api_key)
|
EveManager.create_characters_from_list(characters, user, api_key_pair.api_id)
|
||||||
else:
|
else:
|
||||||
logger.debug("API key %s is no longer valid; it and its characters will be deleted." % api_key_pair.api_id)
|
logger.debug("API key %s is no longer valid; it and its characters will be deleted." % api_key_pair.api_id)
|
||||||
EveManager.delete_characters_by_api_id(api_key_pair.api_id, user.id)
|
EveManager.delete_characters_by_api_id(api_key_pair.api_id, user.id)
|
||||||
|
@ -15,6 +15,15 @@ class EveWhoManager():
|
|||||||
def get_corporation_members(corpid):
|
def get_corporation_members(corpid):
|
||||||
url = "http://evewho.com/api.php?type=corplist&id=%s" % corpid
|
url = "http://evewho.com/api.php?type=corplist&id=%s" % corpid
|
||||||
jsondata = requests.get(url).content
|
jsondata = requests.get(url).content
|
||||||
data=json.loads(jsondata.decode())
|
data = json.loads(jsondata.decode())
|
||||||
|
|
||||||
return {row["character_id"]:{"name":row["name"], "id":row["character_id"]} for row in data["characters"]}
|
members = {}
|
||||||
|
page_count=0
|
||||||
|
while len(data["characters"]):
|
||||||
|
for row in data["characters"]:
|
||||||
|
members[row["character_id"]] = {"name":row["name"], "id":row["character_id"]}
|
||||||
|
page_count=page_count+1
|
||||||
|
jsondata = requests.get(url + "&page=%i" % page_count).content
|
||||||
|
data = json.loads(jsondata.decode())
|
||||||
|
|
||||||
|
return members
|
||||||
|
Loading…
x
Reference in New Issue
Block a user