prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  部门查询接口 ?lookup_field=name，当部门名称中含有 "." 时返回 404
  **用文字描述你遇到的问题**
  
  请用简练的文字描述你遇到的问题，问题描述的清晰程度决定了问题被解决的效率。
  
  **重现方法**
  1. 创建一个目录，名字包含点，如【广东省.深圳市】
  2. 使用api查询， http:://{host:port}/api/v2/departments/广东省.深圳市/?lookup_field=name
  
  查询结果是404
  
  请描述问题重现的方法，如果不方便描述，可以通过截图或者视频辅助。
  
  **预期行为**
  
  预期的正常行为
  
  **版本**
  - 提供用户管理的具体版本号
  - 是否是企业版问题？
  
  **如果是 SaaS 页面问题，请提供使用的操作系统和浏览器信息**
   - OS: [e.g. iOS]
   - Browser [e.g. chrome, safari]
   - Version [e.g. 22]
  
  **额外信息**
  
  任何你觉得有助于问题解决的内容
  
  
  </issue>
  <code>
  [start of src/api/bkuser_core/departments/urls.py]
  1 # -*- coding: utf-8 -*-
  2 """
  3 TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
  4 Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
  5 Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
  6 You may obtain a copy of the License at http://opensource.org/licenses/MIT
  7 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  8 an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  9 specific language governing permissions and limitations under the License.
  10 """
  11 from bkuser_core.common.constants import LOOKUP_FIELD_NAME
  12 from django.conf.urls import url
  13 
  14 from . import views
  15 
  16 PVAR_DEPARTMENT_ID = r"(?P<%s>[\w\-]+)" % LOOKUP_FIELD_NAME
  17 
  18 urlpatterns = [
  19     url(
  20         r"^api/v2/departments/$",
  21         views.DepartmentViewSet.as_view(
  22             {
  23                 "get": "list",
  24                 "post": "create",
  25             }
  26         ),
  27         name="departments",
  28     ),
  29     url(
  30         r"^api/v2/departments/%s/$" % PVAR_DEPARTMENT_ID,
  31         views.DepartmentViewSet.as_view(
  32             {
  33                 "get": "retrieve",
  34                 "post": "update",
  35                 "delete": "destroy",
  36                 "patch": "partial_update",
  37             }
  38         ),
  39         name="departments.action",
  40     ),
  41     url(
  42         r"^api/v2/departments/%s/restoration/$" % PVAR_DEPARTMENT_ID,
  43         views.DepartmentViewSet.as_view(
  44             {
  45                 "post": "restoration",
  46             }
  47         ),
  48         name="departments.restoration",
  49     ),
  50     url(
  51         r"^api/v2/departments/%s/ancestors/$" % PVAR_DEPARTMENT_ID,
  52         views.DepartmentViewSet.as_view(
  53             {
  54                 "get": "get_ancestor",
  55             }
  56         ),
  57         name="departments.ancestors",
  58     ),
  59     url(
  60         r"^api/v2/departments/%s/children/$" % PVAR_DEPARTMENT_ID,
  61         views.DepartmentViewSet.as_view(
  62             {
  63                 "get": "get_children",
  64             }
  65         ),
  66         name="departments.children",
  67     ),
  68     url(
  69         r"^api/v2/departments/%s/profiles/$" % PVAR_DEPARTMENT_ID,
  70         views.DepartmentViewSet.as_view({"get": "get_profiles", "post": "add_profiles"}),
  71         name="departments.profiles",
  72     ),
  73     #########
  74     # Batch #
  75     #########
  76     url(
  77         r"^api/v2/batch/departments/profiles/$",
  78         views.BatchDepartmentsViewSet.as_view(
  79             {
  80                 "get": "multiple_retrieve_profiles",
  81             }
  82         ),
  83         name="department.batch",
  84     ),
  85     ########
  86     # Edge #
  87     ########
  88     url(
  89         r"^api/v2/edges/department_profile/$",
  90         views.DepartmentProfileEdgeViewSet.as_view({"get": "list"}),
  91         name="edge.department_profile",
  92     ),
  93     #############
  94     # shortcuts #
  95     #############
  96     url(
  97         r"^api/v2/shortcuts/departments/tops/$",
  98         views.DepartmentViewSet.as_view({"get": "list_tops"}),
  99         name="shortcuts.departments.list.tops",
  100     ),
  101 ]
  102
  [end of src/api/bkuser_core/departments/urls.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/src/api/bkuser_core/departments/urls.py b/src/api/bkuser_core/departments/urls.py
  --- a/src/api/bkuser_core/departments/urls.py
  +++ b/src/api/bkuser_core/departments/urls.py
  @@ -13,7 +13,7 @@
   
   from . import views
   
  -PVAR_DEPARTMENT_ID = r"(?P<%s>[\w\-]+)" % LOOKUP_FIELD_NAME
  +PVAR_DEPARTMENT_ID = r"(?P<%s>[\w\-\.]+)" % LOOKUP_FIELD_NAME
   
   urlpatterns = [
       url(
  
verification_info: {"golden_diff": "diff --git a/src/api/bkuser_core/departments/urls.py b/src/api/bkuser_core/departments/urls.py\n--- a/src/api/bkuser_core/departments/urls.py\n+++ b/src/api/bkuser_core/departments/urls.py\n@@ -13,7 +13,7 @@\n \n from . import views\n \n-PVAR_DEPARTMENT_ID = r\"(?P<%s>[\\w\\-]+)\" % LOOKUP_FIELD_NAME\n+PVAR_DEPARTMENT_ID = r\"(?P<%s>[\\w\\-\\.]+)\" % LOOKUP_FIELD_NAME\n \n urlpatterns = [\n     url(\n", "issue": "\u90e8\u95e8\u67e5\u8be2\u63a5\u53e3 ?lookup_field=name\uff0c\u5f53\u90e8\u95e8\u540d\u79f0\u4e2d\u542b\u6709 \".\" \u65f6\u8fd4\u56de 404\n**\u7528\u6587\u5b57\u63cf\u8ff0\u4f60\u9047\u5230\u7684\u95ee\u9898**\r\n\r\n\u8bf7\u7528\u7b80\u7ec3\u7684\u6587\u5b57\u63cf\u8ff0\u4f60\u9047\u5230\u7684\u95ee\u9898\uff0c\u95ee\u9898\u63cf\u8ff0\u7684\u6e05\u6670\u7a0b\u5ea6\u51b3\u5b9a\u4e86\u95ee\u9898\u88ab\u89e3\u51b3\u7684\u6548\u7387\u3002\r\n\r\n**\u91cd\u73b0\u65b9\u6cd5**\r\n1. \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u540d\u5b57\u5305\u542b\u70b9\uff0c\u5982\u3010\u5e7f\u4e1c\u7701.\u6df1\u5733\u5e02\u3011\r\n2. \u4f7f\u7528api\u67e5\u8be2\uff0c http:://{host:port}/api/v2/departments/\u5e7f\u4e1c\u7701.\u6df1\u5733\u5e02/?lookup_field=name\r\n\r\n\u67e5\u8be2\u7ed3\u679c\u662f404\r\n\r\n\u8bf7\u63cf\u8ff0\u95ee\u9898\u91cd\u73b0\u7684\u65b9\u6cd5\uff0c\u5982\u679c\u4e0d\u65b9\u4fbf\u63cf\u8ff0\uff0c\u53ef\u4ee5\u901a\u8fc7\u622a\u56fe\u6216\u8005\u89c6\u9891\u8f85\u52a9\u3002\r\n\r\n**\u9884\u671f\u884c\u4e3a**\r\n\r\n\u9884\u671f\u7684\u6b63\u5e38\u884c\u4e3a\r\n\r\n**\u7248\u672c**\r\n- \u63d0\u4f9b\u7528\u6237\u7ba1\u7406\u7684\u5177\u4f53\u7248\u672c\u53f7\r\n- \u662f\u5426\u662f\u4f01\u4e1a\u7248\u95ee\u9898\uff1f\r\n\r\n**\u5982\u679c\u662f SaaS \u9875\u9762\u95ee\u9898\uff0c\u8bf7\u63d0\u4f9b\u4f7f\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u6d4f\u89c8\u5668\u4fe1\u606f**\r\n - OS: [e.g. iOS]\r\n - Browser [e.g. chrome, safari]\r\n - Version [e.g. 22]\r\n\r\n**\u989d\u5916\u4fe1\u606f**\r\n\r\n\u4efb\u4f55\u4f60\u89c9\u5f97\u6709\u52a9\u4e8e\u95ee\u9898\u89e3\u51b3\u7684\u5185\u5bb9\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nTencentBlueKing is pleased to support the open source community by making \u84dd\u9cb8\u667a\u4e91-\u7528\u6237\u7ba1\u7406(Bk-User) available.\nCopyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.\nLicensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\nYou may obtain a copy of the License at http://opensource.org/licenses/MIT\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on\nan \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\"\"\"\nfrom bkuser_core.common.constants import LOOKUP_FIELD_NAME\nfrom django.conf.urls import url\n\nfrom . import views\n\nPVAR_DEPARTMENT_ID = r\"(?P<%s>[\\w\\-]+)\" % LOOKUP_FIELD_NAME\n\nurlpatterns = [\n    url(\n        r\"^api/v2/departments/$\",\n        views.DepartmentViewSet.as_view(\n            {\n                \"get\": \"list\",\n                \"post\": \"create\",\n            }\n        ),\n        name=\"departments\",\n    ),\n    url(\n        r\"^api/v2/departments/%s/$\" % PVAR_DEPARTMENT_ID,\n        views.DepartmentViewSet.as_view(\n            {\n                \"get\": \"retrieve\",\n                \"post\": \"update\",\n                \"delete\": \"destroy\",\n                \"patch\": \"partial_update\",\n            }\n        ),\n        name=\"departments.action\",\n    ),\n    url(\n        r\"^api/v2/departments/%s/restoration/$\" % PVAR_DEPARTMENT_ID,\n        views.DepartmentViewSet.as_view(\n            {\n                \"post\": \"restoration\",\n            }\n        ),\n        name=\"departments.restoration\",\n    ),\n    url(\n        r\"^api/v2/departments/%s/ancestors/$\" % PVAR_DEPARTMENT_ID,\n        views.DepartmentViewSet.as_view(\n            {\n                \"get\": \"get_ancestor\",\n            }\n        ),\n        name=\"departments.ancestors\",\n    ),\n    url(\n        r\"^api/v2/departments/%s/children/$\" % PVAR_DEPARTMENT_ID,\n        views.DepartmentViewSet.as_view(\n            {\n                \"get\": \"get_children\",\n            }\n        ),\n        name=\"departments.children\",\n    ),\n    url(\n        r\"^api/v2/departments/%s/profiles/$\" % PVAR_DEPARTMENT_ID,\n        views.DepartmentViewSet.as_view({\"get\": \"get_profiles\", \"post\": \"add_profiles\"}),\n        name=\"departments.profiles\",\n    ),\n    #########\n    # Batch #\n    #########\n    url(\n        r\"^api/v2/batch/departments/profiles/$\",\n        views.BatchDepartmentsViewSet.as_view(\n            {\n                \"get\": \"multiple_retrieve_profiles\",\n            }\n        ),\n        name=\"department.batch\",\n    ),\n    ########\n    # Edge #\n    ########\n    url(\n        r\"^api/v2/edges/department_profile/$\",\n        views.DepartmentProfileEdgeViewSet.as_view({\"get\": \"list\"}),\n        name=\"edge.department_profile\",\n    ),\n    #############\n    # shortcuts #\n    #############\n    url(\n        r\"^api/v2/shortcuts/departments/tops/$\",\n        views.DepartmentViewSet.as_view({\"get\": \"list_tops\"}),\n        name=\"shortcuts.departments.list.tops\",\n    ),\n]\n", "path": "src/api/bkuser_core/departments/urls.py"}]}