mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Added support for corp calls on EDKAPI
This commit is contained in:
@@ -307,8 +307,11 @@ class EDKApiHandler(BaseHandler):
|
|||||||
def read(self, request):
|
def read(self, request):
|
||||||
|
|
||||||
alliance = request.GET.get('alliance', None)
|
alliance = request.GET.get('alliance', None)
|
||||||
if not alliance:
|
corporation = request.GET.get('corporation', None)
|
||||||
return {'auth': 'missing', 'missing': 'alliance'}
|
if not alliance and not corporation:
|
||||||
|
return {'auth': 'missing', 'missing': ['alliance', 'corp']}
|
||||||
objs = EVEAccount.objects.filter(characters__corporation__alliance=alliance, api_keytype=API_KEYTYPE_CORPORATION, api_status=API_STATUS_OK).extra(where=['(api_accessmask & 256) > 0'])
|
if alliance:
|
||||||
|
objs = EVEAccount.objects.filter(characters__corporation__alliance=alliance, api_keytype=API_KEYTYPE_CORPORATION, api_status=API_STATUS_OK).extra(where=['(api_accessmask & 256) > 0'])
|
||||||
|
elif corporation:
|
||||||
|
objs = EVEAccount.objects.filter(characters__corporation=corporation, api_keytype=API_KEYTYPE_CORPORATION, api_status=API_STATUS_OK).extra(where=['(api_accessmask & 256) > 0'])
|
||||||
return objs.values('api_user_id', 'api_key', 'characters__id', 'characters__name', 'characters__corporation__name')
|
return objs.values('api_user_id', 'api_key', 'characters__id', 'characters__name', 'characters__corporation__name')
|
||||||
|
|||||||
Reference in New Issue
Block a user