Blacklist API endpoint, allows lookup for blacklisted items

This commit is contained in:
2010-10-28 11:39:53 +01:00
parent 49470765ac
commit 1b18598e05
2 changed files with 17 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ from api.models import AuthAPIKey, AuthAPILog
from eve_proxy.models import CachedDocument
from eve_api.models import EVEAccount
from sso.models import ServiceAccount, Service
from hr.models import Blacklist
from settings import FULL_API_USER_ID
from settings import FULL_API_CHARACTER_ID
@@ -195,3 +196,17 @@ class OpTimerHandler(BaseHandler):
'forumLink': ''}]}
else:
return {'ops':events}
class BlacklistHandler(BaseHandler):
allowed_methods = ('GET')
def read(self, request):
if request.GET.get('value'):
obj = Blacklist.objects.filter(value=request.GET.get('value'))
if obj.count() and request.GET.get('type'):
obj = obj.filter(type=request.GET.get('type'))
else:
obj = []
return obj