We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Bug] Search People should return HTTP status 400 when query is missing
Currently, the `/search/people` returns a HTTP 200 code when even for an incorrect API request. For example, if you leave out the `query` param it returns the following body:

```json
{ "error": "No query provided", "ok": false}
```

Yet, the HTTP status code is 200, while it should be 400.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `backend/uclapi/search/views.py`
Content:
```
1 from rest_framework.decorators import api_view
2 from django.http import JsonResponse
3 
4 from roombookings.decorators import does_token_exist, log_api_call, throttle
5 
6 import os
7 import requests
8 
9 
10 @api_view(['GET'])
11 @does_token_exist
12 @throttle
13 @log_api_call
14 def people(request):
15     if "query" not in request.GET:
16         return JsonResponse({
17             "ok": False,
18             "error": "No query provided"
19         })
20 
21     query = request.GET["query"]
22 
23     url = (
24         "{}?{}={}"
25         .format(
26             os.environ["SEARCH_API_URL"],
27             os.environ["SEARCH_API_QUERY_PARAMS"],
28             query,
29         )
30     )
31 
32     r = requests.get(url)
33 
34     results = r.json()["response"]["resultPacket"]["results"][:20]
35 
36     def serialize_person(person):
37         return {
38             "name": person["title"],
39             "department": person["metaData"].get("7", ""),
40             "email": person["metaData"].get("E", ""),
41             "status": person["metaData"].get("g", ""),
42         }
43 
44     people = [serialize_person(person) for person in results]
45 
46     return JsonResponse({
47         "ok": True,
48         "people": people
49     })
50
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/backend/uclapi/search/views.py b/backend/uclapi/search/views.py
--- a/backend/uclapi/search/views.py
+++ b/backend/uclapi/search/views.py
@@ -13,10 +13,12 @@
 @log_api_call
 def people(request):
     if "query" not in request.GET:
-        return JsonResponse({
+        response = JsonResponse({
             "ok": False,
-            "error": "No query provided"
+            "error": "No query provided."
         })
+        response.status_code = 400
+        return response
 
     query = request.GET["query"]

{"golden_diff": "diff --git a/backend/uclapi/search/views.py b/backend/uclapi/search/views.py\n--- a/backend/uclapi/search/views.py\n+++ b/backend/uclapi/search/views.py\n@@ -13,10 +13,12 @@\n @log_api_call\n def people(request):\n     if \"query\" not in request.GET:\n-        return JsonResponse({\n+        response = JsonResponse({\n             \"ok\": False,\n-            \"error\": \"No query provided\"\n+            \"error\": \"No query provided.\"\n         })\n+        response.status_code = 400\n+        return response\n \n     query = request.GET[\"query\"]\n", "issue": "[Bug] Search People should return HTTP status 400 when query is missing\nCurrently, the `/search/people` returns a HTTP 200 code when even for an incorrect API request. For example, if you leave out the `query` param it returns the following body:\r\n\r\n```json\r\n{ \"error\": \"No query provided\", \"ok\": false}\r\n```\r\n\r\nYet, the HTTP status code is 200, while it should be 400.\r\n\n", "before_files": [{"content": "from rest_framework.decorators import api_view\nfrom django.http import JsonResponse\n\nfrom roombookings.decorators import does_token_exist, log_api_call, throttle\n\nimport os\nimport requests\n\n\n@api_view(['GET'])\n@does_token_exist\n@throttle\n@log_api_call\ndef people(request):\n    if \"query\" not in request.GET:\n        return JsonResponse({\n            \"ok\": False,\n            \"error\": \"No query provided\"\n        })\n\n    query = request.GET[\"query\"]\n\n    url = (\n        \"{}?{}={}\"\n        .format(\n            os.environ[\"SEARCH_API_URL\"],\n            os.environ[\"SEARCH_API_QUERY_PARAMS\"],\n            query,\n        )\n    )\n\n    r = requests.get(url)\n\n    results = r.json()[\"response\"][\"resultPacket\"][\"results\"][:20]\n\n    def serialize_person(person):\n        return {\n            \"name\": person[\"title\"],\n            \"department\": person[\"metaData\"].get(\"7\", \"\"),\n            \"email\": person[\"metaData\"].get(\"E\", \"\"),\n            \"status\": person[\"metaData\"].get(\"g\", \"\"),\n        }\n\n    people = [serialize_person(person) for person in results]\n\n    return JsonResponse({\n        \"ok\": True,\n        \"people\": people\n    })\n", "path": "backend/uclapi/search/views.py"}], "after_files": [{"content": "from rest_framework.decorators import api_view\nfrom django.http import JsonResponse\n\nfrom roombookings.decorators import does_token_exist, log_api_call, throttle\n\nimport os\nimport requests\n\n\n@api_view(['GET'])\n@does_token_exist\n@throttle\n@log_api_call\ndef people(request):\n    if \"query\" not in request.GET:\n        response = JsonResponse({\n            \"ok\": False,\n            \"error\": \"No query provided.\"\n        })\n        response.status_code = 400\n        return response\n\n    query = request.GET[\"query\"]\n\n    url = (\n        \"{}?{}={}\"\n        .format(\n            os.environ[\"SEARCH_API_URL\"],\n            os.environ[\"SEARCH_API_QUERY_PARAMS\"],\n            query,\n        )\n    )\n\n    r = requests.get(url)\n\n    results = r.json()[\"response\"][\"resultPacket\"][\"results\"][:20]\n\n    def serialize_person(person):\n        return {\n            \"name\": person[\"title\"],\n            \"department\": person[\"metaData\"].get(\"7\", \"\"),\n            \"email\": person[\"metaData\"].get(\"E\", \"\"),\n            \"status\": person[\"metaData\"].get(\"g\", \"\"),\n        }\n\n    people = [serialize_person(person) for person in results]\n\n    return JsonResponse({\n        \"ok\": True,\n        \"people\": people\n    })\n", "path": "backend/uclapi/search/views.py"}]}