fail if entity is unknown

This commit is contained in:
j 2015-06-24 16:41:49 +02:00
parent ce701d38d0
commit 9758b7d312

View file

@ -44,6 +44,11 @@ def addEntity(request, data):
'''
existing_names = []
exists = False
if not utils.get_by_id(settings.CONFIG['entities'], data['type']):
response = json_response(status=500, text='unknown entity type')
return render_to_json_response(response)
if 'name' in data:
names = [data['name']] + data.get('alternativeNames', [])
for name in names: