view website/issues/html/user.forgotten.html @ 5548:fea11d05110e

Avoid errors from selecting "no selection" on multilink (issue2550722). As discussed in issue 2550722 there are various cases where selecting "no selection" on a multilink can result in inappropriate errors from Roundup: * If selecting "no selection" produces a null edit (a value was set in the multilink in an edit with an error, then removed again, along with all other changes, in the next form submission), so the page is rendered from the form contents including the "-<id>" value for "no selection" for the multilink. * If creating an item with a nonempty value for a multilink has an error, and the resubmission changes that multilink to "no selection" (and this in turn has subcases, according to whether the creation then succeeds or fails on the resubmission, which need fixes in different places in the Roundup code). All of these cases have in common that it is expected and OK to have a "-<id>" value for a submission for a multilink when <id> is not set in that multilink in the database (because the original attempt to set <id> in that multilink had an error), so the hyperdb.py logic to give an error in that case is thus removed. In the subcase of the second case where the resubmission with "no selection" has an error, the templating code tries to produce a menu entry for the "-<id>" multilink value, which also results in an error, hence the templating.py change to ignore such values in the list for a multilink.
author Joseph Myers <jsm@polyomino.org.uk>
date Thu, 27 Sep 2018 11:33:01 +0000
parents f63a2b15e628
children 4d32fa88c5d2
line wrap: on
line source

<tal:block metal:use-macro="templates/page/macros/icing">
<title metal:fill-slot="head_title" i18n:translate="">Password reset request - <span
 i18n:name="tracker" tal:replace="config/TRACKER_NAME" /></title>
<span metal:fill-slot="body_title" tal:omit-tag="python:1"
 i18n:translate="">Password reset request</span>
<td class="content" metal:fill-slot="content">

<tal:askforinfo tal:condition="python:options['error_message'] or not request.form.has_key('@action')"> 

<p i18n:translate="">You have two options if you have forgotten your password.
If you know the email address you registered with, enter it below.</p>

<p i18n:translate="">If your  user was  automatically  created during
import  from  the old  sourceforge  tracker,  your  e-mail address  is
&lt;Sourceforge  username&gt;@users.sourceforge.net. The  mail address
associated with your account can be changed after login.</p>

<form method="POST" onSubmit="return submit_once()"
      tal:attributes="action context/designator">
    <table class="form">
      <tr>
        <th i18n:translate="">Email Address:</th>
        <td><input name="address"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <input type="hidden" name="@action" value="passrst">
          <input type="hidden" name="@template" value="forgotten">
          <input type="submit" value="Request password reset"
           i18n:attributes="value">
	  <input name="@csrf" type="hidden"
		 tal:attributes="value python:utils.anti_csrf_nonce()">
        </td>
      </tr>
</table>

<p i18n:translate="">Or, if you know your username, then enter it below.</p>

<p i18n:translate="">If you have previously created or modified issue
reports in the sourceforge issue tracker, you have an account here with
the same username as your sourceforge username.</p>

<table class="form">
 <tr><th i18n:translate="">Username:</th> <td><input name="username"></td> </tr>
 <tr><td></td><td><input type="submit" value="Request password reset"
   i18n:attributes="value"></td></tr>
</table>
<input name="@csrf" type="hidden"
       tal:attributes="value python:utils.anti_csrf_nonce()">
</form>

<p i18n:translate="">A confirmation email will be sent to you -
please follow the instructions within it to complete the reset process.</p>

</tal:askforinfo>

</td>
g
</tal:block>

Roundup Issue Tracker: http://roundup-tracker.org/