prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  mail_password form crashes if user is not found
  Visiting /mali_password without providing a userid will simply crash. And if mail_password_form is submitted and a user is not found, or the user doesn't have an email configured, it will crash as well.
  
  </issue>
  <code>
  [start of Products/CMFPlone/browser/login/mail_password.py]
  1 # -*- coding: utf-8 -*-
  2 from AccessControl import Unauthorized
  3 from Products.CMFPlone import PloneMessageFactory as _
  4 from Products.Five import BrowserView
  5 from Products.statusmessages.interfaces import IStatusMessage
  6 
  7 
  8 class MailPasswordView(BrowserView):
  9 
  10     def __call__(self):
  11         try:
  12             response = self.context.portal_registration.mailPassword(
  13                 self.request.form.get('userid', ''),
  14                 self.request,
  15             )
  16         except ValueError as e:
  17             try:
  18                 msg = _(str(e))
  19             except Unauthorized:
  20                 # If we are not allowed to tell the user, what is wrong, he
  21                 # should get an error message and contact the admins
  22                 raise e
  23             IStatusMessage(self.request).add(msg)
  24             self.request.response.redirect(
  25                 self.context.absolute_url() + 'mail_password_form'
  26             )
  27         return response
  28
  [end of Products/CMFPlone/browser/login/mail_password.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/Products/CMFPlone/browser/login/mail_password.py b/Products/CMFPlone/browser/login/mail_password.py
  --- a/Products/CMFPlone/browser/login/mail_password.py
  +++ b/Products/CMFPlone/browser/login/mail_password.py
  @@ -8,6 +8,7 @@
   class MailPasswordView(BrowserView):
   
       def __call__(self):
  +        response = None
           try:
               response = self.context.portal_registration.mailPassword(
                   self.request.form.get('userid', ''),
  @@ -22,6 +23,6 @@
                   raise e
               IStatusMessage(self.request).add(msg)
               self.request.response.redirect(
  -                self.context.absolute_url() + 'mail_password_form'
  +                self.context.absolute_url() + '/mail_password_form'
               )
           return response
  
verification_info: {"golden_diff": "diff --git a/Products/CMFPlone/browser/login/mail_password.py b/Products/CMFPlone/browser/login/mail_password.py\n--- a/Products/CMFPlone/browser/login/mail_password.py\n+++ b/Products/CMFPlone/browser/login/mail_password.py\n@@ -8,6 +8,7 @@\n class MailPasswordView(BrowserView):\n \n     def __call__(self):\n+        response = None\n         try:\n             response = self.context.portal_registration.mailPassword(\n                 self.request.form.get('userid', ''),\n@@ -22,6 +23,6 @@\n                 raise e\n             IStatusMessage(self.request).add(msg)\n             self.request.response.redirect(\n-                self.context.absolute_url() + 'mail_password_form'\n+                self.context.absolute_url() + '/mail_password_form'\n             )\n         return response\n", "issue": "mail_password form crashes if user is not found\nVisiting /mali_password without providing a userid will simply crash. And if mail_password_form is submitted and a user is not found, or the user doesn't have an email configured, it will crash as well.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom AccessControl import Unauthorized\nfrom Products.CMFPlone import PloneMessageFactory as _\nfrom Products.Five import BrowserView\nfrom Products.statusmessages.interfaces import IStatusMessage\n\n\nclass MailPasswordView(BrowserView):\n\n    def __call__(self):\n        try:\n            response = self.context.portal_registration.mailPassword(\n                self.request.form.get('userid', ''),\n                self.request,\n            )\n        except ValueError as e:\n            try:\n                msg = _(str(e))\n            except Unauthorized:\n                # If we are not allowed to tell the user, what is wrong, he\n                # should get an error message and contact the admins\n                raise e\n            IStatusMessage(self.request).add(msg)\n            self.request.response.redirect(\n                self.context.absolute_url() + 'mail_password_form'\n            )\n        return response\n", "path": "Products/CMFPlone/browser/login/mail_password.py"}]}