prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  T - Add 301 redirect to Subscriptions Management page 
  `/payments/recurring/management` is moving to `/payments/management`, therefore we need to add 301 redirect in kuma/payments/urls.py
  
  See https://github.com/mdn/kuma/issues/6703#issuecomment-614246571 for context 
  
  </issue>
  <code>
  [start of kuma/payments/urls.py]
  1 from django.urls import path
  2 
  3 from . import views
  4 
  5 lang_urlpatterns = [
  6     path("terms/", views.payment_terms, name="payment_terms"),
  7     path("thank-you/", views.thank_you, name="thank_you"),
  8     path("management/", views.payment_management, name="payment_management",),
  9     path("", views.index, name="payments_index"),
  10 ]
  11
  [end of kuma/payments/urls.py]
  [start of kuma/payments/views.py]
  1 import logging
  2 
  3 from django.shortcuts import render
  4 from django.views.decorators.cache import never_cache
  5 from waffle.decorators import waffle_flag
  6 
  7 from kuma.users.models import User
  8 
  9 
  10 log = logging.getLogger("kuma.payments.views")
  11 
  12 
  13 @never_cache
  14 def index(request):
  15     highest_subscriber_number = User.get_highest_subscriber_number()
  16     # TODO: This is never unit tested because our tests never test SSR rendering.
  17     # See https://github.com/mdn/kuma/issues/6797
  18     context = {"next_subscriber_number": highest_subscriber_number + 1}
  19     return render(request, "payments/index.html", context)
  20 
  21 
  22 @waffle_flag("subscription")
  23 @never_cache
  24 def thank_you(request):
  25     return render(request, "payments/thank-you.html")
  26 
  27 
  28 @waffle_flag("subscription")
  29 @never_cache
  30 def payment_terms(request):
  31     return render(request, "payments/terms.html")
  32 
  33 
  34 @waffle_flag("subscription")
  35 @never_cache
  36 def payment_management(request):
  37     return render(request, "payments/management.html")
  38
  [end of kuma/payments/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/kuma/payments/urls.py b/kuma/payments/urls.py
  --- a/kuma/payments/urls.py
  +++ b/kuma/payments/urls.py
  @@ -1,10 +1,17 @@
   from django.urls import path
  +from django.views.generic import RedirectView
   
   from . import views
   
   lang_urlpatterns = [
       path("terms/", views.payment_terms, name="payment_terms"),
       path("thank-you/", views.thank_you, name="thank_you"),
  -    path("management/", views.payment_management, name="payment_management",),
  +    path(
  +        # This is the old URL we had for a while
  +        "recurring/management/",
  +        RedirectView.as_view(pattern_name="payment_management", permanent=True),
  +        name="recurring_payment_management",
  +    ),
  +    path("management/", views.payment_management, name="payment_management"),
       path("", views.index, name="payments_index"),
   ]
  diff --git a/kuma/payments/views.py b/kuma/payments/views.py
  --- a/kuma/payments/views.py
  +++ b/kuma/payments/views.py
  @@ -13,8 +13,6 @@
   @never_cache
   def index(request):
       highest_subscriber_number = User.get_highest_subscriber_number()
  -    # TODO: This is never unit tested because our tests never test SSR rendering.
  -    # See https://github.com/mdn/kuma/issues/6797
       context = {"next_subscriber_number": highest_subscriber_number + 1}
       return render(request, "payments/index.html", context)
  
verification_info: {"golden_diff": "diff --git a/kuma/payments/urls.py b/kuma/payments/urls.py\n--- a/kuma/payments/urls.py\n+++ b/kuma/payments/urls.py\n@@ -1,10 +1,17 @@\n from django.urls import path\n+from django.views.generic import RedirectView\n \n from . import views\n \n lang_urlpatterns = [\n     path(\"terms/\", views.payment_terms, name=\"payment_terms\"),\n     path(\"thank-you/\", views.thank_you, name=\"thank_you\"),\n-    path(\"management/\", views.payment_management, name=\"payment_management\",),\n+    path(\n+        # This is the old URL we had for a while\n+        \"recurring/management/\",\n+        RedirectView.as_view(pattern_name=\"payment_management\", permanent=True),\n+        name=\"recurring_payment_management\",\n+    ),\n+    path(\"management/\", views.payment_management, name=\"payment_management\"),\n     path(\"\", views.index, name=\"payments_index\"),\n ]\ndiff --git a/kuma/payments/views.py b/kuma/payments/views.py\n--- a/kuma/payments/views.py\n+++ b/kuma/payments/views.py\n@@ -13,8 +13,6 @@\n @never_cache\n def index(request):\n     highest_subscriber_number = User.get_highest_subscriber_number()\n-    # TODO: This is never unit tested because our tests never test SSR rendering.\n-    # See https://github.com/mdn/kuma/issues/6797\n     context = {\"next_subscriber_number\": highest_subscriber_number + 1}\n     return render(request, \"payments/index.html\", context)\n", "issue": "T - Add 301 redirect to Subscriptions Management page \n`/payments/recurring/management` is moving to `/payments/management`, therefore we need to add 301 redirect in kuma/payments/urls.py\r\n\r\nSee https://github.com/mdn/kuma/issues/6703#issuecomment-614246571 for context \n", "before_files": [{"content": "from django.urls import path\n\nfrom . import views\n\nlang_urlpatterns = [\n    path(\"terms/\", views.payment_terms, name=\"payment_terms\"),\n    path(\"thank-you/\", views.thank_you, name=\"thank_you\"),\n    path(\"management/\", views.payment_management, name=\"payment_management\",),\n    path(\"\", views.index, name=\"payments_index\"),\n]\n", "path": "kuma/payments/urls.py"}, {"content": "import logging\n\nfrom django.shortcuts import render\nfrom django.views.decorators.cache import never_cache\nfrom waffle.decorators import waffle_flag\n\nfrom kuma.users.models import User\n\n\nlog = logging.getLogger(\"kuma.payments.views\")\n\n\n@never_cache\ndef index(request):\n    highest_subscriber_number = User.get_highest_subscriber_number()\n    # TODO: This is never unit tested because our tests never test SSR rendering.\n    # See https://github.com/mdn/kuma/issues/6797\n    context = {\"next_subscriber_number\": highest_subscriber_number + 1}\n    return render(request, \"payments/index.html\", context)\n\n\n@waffle_flag(\"subscription\")\n@never_cache\ndef thank_you(request):\n    return render(request, \"payments/thank-you.html\")\n\n\n@waffle_flag(\"subscription\")\n@never_cache\ndef payment_terms(request):\n    return render(request, \"payments/terms.html\")\n\n\n@waffle_flag(\"subscription\")\n@never_cache\ndef payment_management(request):\n    return render(request, \"payments/management.html\")\n", "path": "kuma/payments/views.py"}]}