prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  
  </issue>
  <code>
  [start of backend/uclapi/search/views.py]
  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 of backend/uclapi/search/views.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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"]
  
verification_info: {"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"}]}