<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #2745: Password reset returns an exception if the key parameter is missing</title>
    <link>http://localhost/ticket/2745</link>
    <description>&lt;p&gt;
Instead of showing a notice, the password reset page throws an exception if the key parameter is missing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;Module ckan.controllers.user:329 in perform_reset
         c.reset_key = request.params.get('key')
               if not mailer.verify_reset_link(user_obj, c.reset_key):
                   h.flash_error(_('Invalid reset key. Please try again.'))
                   abort(403)
 if not mailer.verify_reset_link(user_obj, c.reset_key):
Module ckan.lib.mailer:100 in verify_reset_link
     if not user.reset_key or len(user.reset_key) &amp;lt; 5:
               return False
           return key.strip() == user.reset_key
 return key.strip() == user.reset_key
AttributeError: 'NoneType' object has no attribute 'strip'
&lt;/pre&gt;&lt;p&gt;
Apart from the obvious fix of checking for the 'key' parameter, it seems like is quite common to get these reset urls without the key parameter, so I suspect some email clients might strip the query params when building the links. We could avoid this problem by making the key part of the url instead of a param:
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="http://thedatahub.org/en/user/reset/3086e91c-fe09-4a98-92e1-19de67a9ac9d/b4c2d03fa8"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://thedatahub.org/en/user/reset/3086e91c-fe09-4a98-92e1-19de67a9ac9d/b4c2d03fa8&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
instead of:
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="http://thedatahub.org/en/user/reset/3086e91c-fe09-4a98-92e1-19de67a9ac9d?key=b4c2d03fa8"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://thedatahub.org/en/user/reset/3086e91c-fe09-4a98-92e1-19de67a9ac9d?key=b4c2d03fa8&lt;/a&gt;
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/2745</link>
    </image>
    <generator>Trac 0.12.3</generator>
 </channel>
</rss>