fail if entity is unknown
This commit is contained in:
parent
ce701d38d0
commit
9758b7d312
1 changed files with 5 additions and 0 deletions
|
@ -44,6 +44,11 @@ def addEntity(request, data):
|
||||||
'''
|
'''
|
||||||
existing_names = []
|
existing_names = []
|
||||||
exists = False
|
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:
|
if 'name' in data:
|
||||||
names = [data['name']] + data.get('alternativeNames', [])
|
names = [data['name']] + data.get('alternativeNames', [])
|
||||||
for name in names:
|
for name in names:
|
||||||
|
|
Loading…
Reference in a new issue