prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  First time password reset should redirect to login page instead of confirmation page
  ## Description
  * After the user resets their password at the page: `/auth/password_reset_confirm`, they are redirected to `/auth/reset/done/`.
  * They should be redirected to `/auth/login` instead.
  
  </issue>
  <code>
  [start of mathesar/users/password_reset.py]
  1 from django.contrib.auth.forms import SetPasswordForm
  2 from django.contrib.auth.views import PasswordResetConfirmView
  3 from django.utils.decorators import method_decorator
  4 from django.views.decorators.cache import never_cache
  5 from django.views.decorators.debug import sensitive_post_parameters
  6 from django.utils.translation import gettext_lazy as _
  7 
  8 
  9 class MathesarSetPasswordForm(SetPasswordForm):
  10     def save(self, commit=True):
  11         password = self.cleaned_data["new_password1"]
  12         self.user.set_password(password)
  13         # Default password is replaced with a password is set by the user, so change the status
  14         self.user.password_change_needed = False
  15         if commit:
  16             self.user.save()
  17         return self.user
  18 
  19 
  20 class MathesarPasswordResetConfirmView(PasswordResetConfirmView):
  21     # Override default form as we need custom save behaviour
  22     form_class = MathesarSetPasswordForm
  23     template_name = 'users/password_reset_confirmation.html'
  24     title = _('Change Default Password')
  25 
  26     @method_decorator(sensitive_post_parameters())
  27     @method_decorator(never_cache)
  28     def dispatch(self, *args, **kwargs):
  29         self.user = self.request.user
  30         self.validlink = True
  31         # Avoid calling the PasswordResetConfirmView `dispatch` method
  32         # as it contains behaviours not suited for our user flow
  33         return super(PasswordResetConfirmView, self).dispatch(*args, **kwargs)
  34 
  35     def form_valid(self, form):
  36         form.save()
  37         return super(PasswordResetConfirmView, self).form_valid(form)
  38
  [end of mathesar/users/password_reset.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/mathesar/users/password_reset.py b/mathesar/users/password_reset.py
  --- a/mathesar/users/password_reset.py
  +++ b/mathesar/users/password_reset.py
  @@ -22,6 +22,7 @@
       form_class = MathesarSetPasswordForm
       template_name = 'users/password_reset_confirmation.html'
       title = _('Change Default Password')
  +    success_url = "/auth/login"
   
       @method_decorator(sensitive_post_parameters())
       @method_decorator(never_cache)
  
verification_info: {"golden_diff": "diff --git a/mathesar/users/password_reset.py b/mathesar/users/password_reset.py\n--- a/mathesar/users/password_reset.py\n+++ b/mathesar/users/password_reset.py\n@@ -22,6 +22,7 @@\n     form_class = MathesarSetPasswordForm\n     template_name = 'users/password_reset_confirmation.html'\n     title = _('Change Default Password')\n+    success_url = \"/auth/login\"\n \n     @method_decorator(sensitive_post_parameters())\n     @method_decorator(never_cache)\n", "issue": "First time password reset should redirect to login page instead of confirmation page\n## Description\r\n* After the user resets their password at the page: `/auth/password_reset_confirm`, they are redirected to `/auth/reset/done/`.\r\n* They should be redirected to `/auth/login` instead.\n", "before_files": [{"content": "from django.contrib.auth.forms import SetPasswordForm\nfrom django.contrib.auth.views import PasswordResetConfirmView\nfrom django.utils.decorators import method_decorator\nfrom django.views.decorators.cache import never_cache\nfrom django.views.decorators.debug import sensitive_post_parameters\nfrom django.utils.translation import gettext_lazy as _\n\n\nclass MathesarSetPasswordForm(SetPasswordForm):\n    def save(self, commit=True):\n        password = self.cleaned_data[\"new_password1\"]\n        self.user.set_password(password)\n        # Default password is replaced with a password is set by the user, so change the status\n        self.user.password_change_needed = False\n        if commit:\n            self.user.save()\n        return self.user\n\n\nclass MathesarPasswordResetConfirmView(PasswordResetConfirmView):\n    # Override default form as we need custom save behaviour\n    form_class = MathesarSetPasswordForm\n    template_name = 'users/password_reset_confirmation.html'\n    title = _('Change Default Password')\n\n    @method_decorator(sensitive_post_parameters())\n    @method_decorator(never_cache)\n    def dispatch(self, *args, **kwargs):\n        self.user = self.request.user\n        self.validlink = True\n        # Avoid calling the PasswordResetConfirmView `dispatch` method\n        # as it contains behaviours not suited for our user flow\n        return super(PasswordResetConfirmView, self).dispatch(*args, **kwargs)\n\n    def form_valid(self, form):\n        form.save()\n        return super(PasswordResetConfirmView, self).form_valid(form)\n", "path": "mathesar/users/password_reset.py"}]}