prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Route History shouldn‘t be editable
  Editing or adding a new Route History:
  
  ![IMG_2238](https://github.com/frappe/frappe/assets/46800703/caf5ccf6-80c0-4d66-8ed8-1716eaf27f52)
  ![IMG_2240](https://github.com/frappe/frappe/assets/46800703/ff1d1ae5-f657-4607-a27e-e390096b5144)
  
  … shouldn’t be possible, not even for the Administrator.
  
  </issue>
  <code>
  [start of frappe/desk/doctype/route_history/route_history.py]
  1 # Copyright (c) 2022, Frappe Technologies and contributors
  2 # License: MIT. See LICENSE
  3 
  4 import frappe
  5 from frappe.deferred_insert import deferred_insert as _deferred_insert
  6 from frappe.model.document import Document
  7 
  8 
  9 class RouteHistory(Document):
  10 	# begin: auto-generated types
  11 	# This code is auto-generated. Do not modify anything in this block.
  12 
  13 	from typing import TYPE_CHECKING
  14 
  15 	if TYPE_CHECKING:
  16 		from frappe.types import DF
  17 
  18 		route: DF.Data | None
  19 		user: DF.Link | None
  20 	# end: auto-generated types
  21 	@staticmethod
  22 	def clear_old_logs(days=30):
  23 		from frappe.query_builder import Interval
  24 		from frappe.query_builder.functions import Now
  25 
  26 		table = frappe.qb.DocType("Route History")
  27 		frappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))
  28 
  29 
  30 @frappe.whitelist()
  31 def deferred_insert(routes):
  32 	routes = [
  33 		{
  34 			"user": frappe.session.user,
  35 			"route": route.get("route"),
  36 			"creation": route.get("creation"),
  37 		}
  38 		for route in frappe.parse_json(routes)
  39 	]
  40 
  41 	_deferred_insert("Route History", routes)
  42 
  43 
  44 @frappe.whitelist()
  45 def frequently_visited_links():
  46 	return frappe.get_all(
  47 		"Route History",
  48 		fields=["route", "count(name) as count"],
  49 		filters={"user": frappe.session.user},
  50 		group_by="route",
  51 		order_by="count desc",
  52 		limit=5,
  53 	)
  54
  [end of frappe/desk/doctype/route_history/route_history.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/frappe/desk/doctype/route_history/route_history.py b/frappe/desk/doctype/route_history/route_history.py
  --- a/frappe/desk/doctype/route_history/route_history.py
  +++ b/frappe/desk/doctype/route_history/route_history.py
  @@ -18,6 +18,7 @@
   		route: DF.Data | None
   		user: DF.Link | None
   	# end: auto-generated types
  +
   	@staticmethod
   	def clear_old_logs(days=30):
   		from frappe.query_builder import Interval
  
verification_info: {"golden_diff": "diff --git a/frappe/desk/doctype/route_history/route_history.py b/frappe/desk/doctype/route_history/route_history.py\n--- a/frappe/desk/doctype/route_history/route_history.py\n+++ b/frappe/desk/doctype/route_history/route_history.py\n@@ -18,6 +18,7 @@\n \t\troute: DF.Data | None\n \t\tuser: DF.Link | None\n \t# end: auto-generated types\n+\n \t@staticmethod\n \tdef clear_old_logs(days=30):\n \t\tfrom frappe.query_builder import Interval\n", "issue": "Route History shouldn\u2018t be editable\nEditing or adding a new Route History:\r\n\r\n![IMG_2238](https://github.com/frappe/frappe/assets/46800703/caf5ccf6-80c0-4d66-8ed8-1716eaf27f52)\r\n![IMG_2240](https://github.com/frappe/frappe/assets/46800703/ff1d1ae5-f657-4607-a27e-e390096b5144)\r\n\r\n\u2026 shouldn\u2019t be possible, not even for the Administrator.\n", "before_files": [{"content": "# Copyright (c) 2022, Frappe Technologies and contributors\n# License: MIT. See LICENSE\n\nimport frappe\nfrom frappe.deferred_insert import deferred_insert as _deferred_insert\nfrom frappe.model.document import Document\n\n\nclass RouteHistory(Document):\n\t# begin: auto-generated types\n\t# This code is auto-generated. Do not modify anything in this block.\n\n\tfrom typing import TYPE_CHECKING\n\n\tif TYPE_CHECKING:\n\t\tfrom frappe.types import DF\n\n\t\troute: DF.Data | None\n\t\tuser: DF.Link | None\n\t# end: auto-generated types\n\t@staticmethod\n\tdef clear_old_logs(days=30):\n\t\tfrom frappe.query_builder import Interval\n\t\tfrom frappe.query_builder.functions import Now\n\n\t\ttable = frappe.qb.DocType(\"Route History\")\n\t\tfrappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))\n\n\n@frappe.whitelist()\ndef deferred_insert(routes):\n\troutes = [\n\t\t{\n\t\t\t\"user\": frappe.session.user,\n\t\t\t\"route\": route.get(\"route\"),\n\t\t\t\"creation\": route.get(\"creation\"),\n\t\t}\n\t\tfor route in frappe.parse_json(routes)\n\t]\n\n\t_deferred_insert(\"Route History\", routes)\n\n\n@frappe.whitelist()\ndef frequently_visited_links():\n\treturn frappe.get_all(\n\t\t\"Route History\",\n\t\tfields=[\"route\", \"count(name) as count\"],\n\t\tfilters={\"user\": frappe.session.user},\n\t\tgroup_by=\"route\",\n\t\torder_by=\"count desc\",\n\t\tlimit=5,\n\t)\n", "path": "frappe/desk/doctype/route_history/route_history.py"}]}