displaying a message in case of non-existent field name for the search function of stacky server
This commit is contained in:
parent
8de2daf8d9
commit
c2a76faeb9
@ -600,5 +600,8 @@ def search(request):
|
||||
routing_key_status = routing_key_type(event.routing_key)
|
||||
results = event.search_results(results, when, routing_key_status)
|
||||
return rsp(json.dumps(results))
|
||||
except ObjectDoesNotExist or FieldError:
|
||||
return rsp([])
|
||||
except ObjectDoesNotExist:
|
||||
return rsp(["The requested object does not exist"])
|
||||
except FieldError:
|
||||
return rsp(["The requested field '%s' does not exist for the corresponding object.\n"
|
||||
"Note: The field names of database are case-sensitive." % field] )
|
||||
|
Loading…
x
Reference in New Issue
Block a user