prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Admin: Fix category name in category edit view
  Do not show the category with hierarchy on breadcrumbs and title
  
  ![image](https://user-images.githubusercontent.com/8770370/46307475-6926a100-c58d-11e8-82cf-cac5729c7563.png)
  
  
  </issue>
  <code>
  [start of shuup/admin/modules/categories/views/edit.py]
  1 # -*- coding: utf-8 -*-
  2 # This file is part of Shuup.
  3 #
  4 # Copyright (c) 2012-2018, Shuup Inc. All rights reserved.
  5 #
  6 # This source code is licensed under the OSL-3.0 license found in the
  7 # LICENSE file in the root directory of this source tree.
  8 from django.core.urlresolvers import reverse_lazy
  9 
  10 from shuup.admin.form_part import FormPartsViewMixin, SaveFormPartsMixin
  11 from shuup.admin.modules.categories.form_parts import (
  12     CategoryBaseFormPart, CategoryProductFormPart
  13 )
  14 from shuup.admin.shop_provider import get_shop
  15 from shuup.admin.toolbar import get_default_edit_toolbar
  16 from shuup.admin.utils.tour import is_tour_complete
  17 from shuup.admin.utils.views import CreateOrUpdateView
  18 from shuup.core.models import Category
  19 
  20 
  21 class CategoryEditView(SaveFormPartsMixin, FormPartsViewMixin, CreateOrUpdateView):
  22     model = Category
  23     template_name = "shuup/admin/categories/edit.jinja"
  24     context_object_name = "category"
  25     base_form_part_classes = [CategoryBaseFormPart, CategoryProductFormPart]
  26     form_part_class_provide_key = "admin_category_form_part"
  27 
  28     def get_toolbar(self):
  29         save_form_id = self.get_save_form_id()
  30         object = self.get_object()
  31         delete_url = reverse_lazy("shuup_admin:category.delete", kwargs={"pk": object.pk}) if object.pk else None
  32         return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
  33 
  34     def get_context_data(self, **kwargs):
  35         context = super(CategoryEditView, self).get_context_data(**kwargs)
  36         context["tour_key"] = "category"
  37         context["tour_complete"] = is_tour_complete(get_shop(self.request), "category")
  38         return context
  39 
  40     def form_valid(self, form):
  41         return self.save_form_parts(form)
  42 
  43     def get_queryset(self):
  44         return Category.objects.all_except_deleted(shop=get_shop(self.request))
  45
  [end of shuup/admin/modules/categories/views/edit.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/shuup/admin/modules/categories/views/edit.py b/shuup/admin/modules/categories/views/edit.py
  --- a/shuup/admin/modules/categories/views/edit.py
  +++ b/shuup/admin/modules/categories/views/edit.py
  @@ -35,6 +35,9 @@
           context = super(CategoryEditView, self).get_context_data(**kwargs)
           context["tour_key"] = "category"
           context["tour_complete"] = is_tour_complete(get_shop(self.request), "category")
  +        if self.object.pk:
  +            context["title"] = self.object.name
  +
           return context
   
       def form_valid(self, form):
  
verification_info: {"golden_diff": "diff --git a/shuup/admin/modules/categories/views/edit.py b/shuup/admin/modules/categories/views/edit.py\n--- a/shuup/admin/modules/categories/views/edit.py\n+++ b/shuup/admin/modules/categories/views/edit.py\n@@ -35,6 +35,9 @@\n         context = super(CategoryEditView, self).get_context_data(**kwargs)\n         context[\"tour_key\"] = \"category\"\n         context[\"tour_complete\"] = is_tour_complete(get_shop(self.request), \"category\")\n+        if self.object.pk:\n+            context[\"title\"] = self.object.name\n+\n         return context\n \n     def form_valid(self, form):\n", "issue": "Admin: Fix category name in category edit view\nDo not show the category with hierarchy on breadcrumbs and title\r\n\r\n![image](https://user-images.githubusercontent.com/8770370/46307475-6926a100-c58d-11e8-82cf-cac5729c7563.png)\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This file is part of Shuup.\n#\n# Copyright (c) 2012-2018, Shuup Inc. All rights reserved.\n#\n# This source code is licensed under the OSL-3.0 license found in the\n# LICENSE file in the root directory of this source tree.\nfrom django.core.urlresolvers import reverse_lazy\n\nfrom shuup.admin.form_part import FormPartsViewMixin, SaveFormPartsMixin\nfrom shuup.admin.modules.categories.form_parts import (\n    CategoryBaseFormPart, CategoryProductFormPart\n)\nfrom shuup.admin.shop_provider import get_shop\nfrom shuup.admin.toolbar import get_default_edit_toolbar\nfrom shuup.admin.utils.tour import is_tour_complete\nfrom shuup.admin.utils.views import CreateOrUpdateView\nfrom shuup.core.models import Category\n\n\nclass CategoryEditView(SaveFormPartsMixin, FormPartsViewMixin, CreateOrUpdateView):\n    model = Category\n    template_name = \"shuup/admin/categories/edit.jinja\"\n    context_object_name = \"category\"\n    base_form_part_classes = [CategoryBaseFormPart, CategoryProductFormPart]\n    form_part_class_provide_key = \"admin_category_form_part\"\n\n    def get_toolbar(self):\n        save_form_id = self.get_save_form_id()\n        object = self.get_object()\n        delete_url = reverse_lazy(\"shuup_admin:category.delete\", kwargs={\"pk\": object.pk}) if object.pk else None\n        return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)\n\n    def get_context_data(self, **kwargs):\n        context = super(CategoryEditView, self).get_context_data(**kwargs)\n        context[\"tour_key\"] = \"category\"\n        context[\"tour_complete\"] = is_tour_complete(get_shop(self.request), \"category\")\n        return context\n\n    def form_valid(self, form):\n        return self.save_form_parts(form)\n\n    def get_queryset(self):\n        return Category.objects.all_except_deleted(shop=get_shop(self.request))\n", "path": "shuup/admin/modules/categories/views/edit.py"}]}