Hi,

Ah, I forget that form.custom.begin is an XML object (more like a string) 
> and doesn't change when you directly manipulate the form object itself. You 
> could do:
>
> f.custom.begin = '%s id="login">' % f.custom.begin[:-1]
>

 I added the above code line in controller. The attribute id was added to 
the form element, but the whole <form> being tag was rendered as :

*"*
    <form method="post" id="login">*"*
*
*
i.e form is displayed a text element and hence JS was not working on it.

 

>     if login_form.errors:
>>         login_form.errors.email='Email/Password does not match'
>>
>>     return dict(login_form=login_form)
>>
>> In the view I have :
>>
>>                     <tr class="error">
>>                         <td colspan="2"><!-- Show error here --></td>
>>                     </tr>
>>
>
> Maybe something like:
>
>     {{if login_form.errors.email:}}
>     <tr class="error">
>         <td colspan="2">{{=login_form.errors.email}}</td>
>     </tr>
>     {{pass}}
>
>
I didn't want to render the <tr> element dynamically, so I tried the 
following:

                    <tr class="error">
                        <td colspan="2">
                            {{if login_form.errors:}}
                                {{=login_form.errors.email}}
                                {{pass}}
                        </td>
                    </tr>

But nothing is happening. 
In usual cases, if I leave the field empty or enter an invalid email 
address, an error is displayed but not in this case.
Even if there are errors, the *login_form.errors* object is empty and 
nothing is displayed.

How does auth handle authentication errors ?

Reply via email to