Thanks that works exactly how I need it to. On Thu, Mar 29, 2012 at 11:22 AM, Marin Pranjić <[email protected]>wrote:
> Yes you can capture the form submit. > Instead of: > > def user(): > .. return dict(form=auth()) > > you can do: > > def user(): > .. #TODO validate submitted username > .. if request.args(0) == 'login' and request.post_vars.username: > .. .. request.post_vars.username = request.vars.username = > request.post_vars.username[:-1] # remove last character > .. return dict(form=auth()) > > > Note you should do things before calling auth(). > > Marin > > On Thu, Mar 29, 2012 at 8:09 PM, Bruce Wade <[email protected]> wrote: > >> Hi, >> >> I need to be able to add a character to the end of a username that can be >> changed by us. This character is not actually stored in the database for >> the username however it must be entered for the username to validate. >> >> For example: >> username: 0000012 -> is stored in the database >> >> Login with: 0000012 would fail >> Login with: 0000012R would succeed >> >> This is a business requirement so even if I don't like this idea I still >> need to program it. How to make this work with the current login system? Is >> there a way to capture the form submit before the handler actually >> processes it, pull the last character if it is valid pass the username >> without the character to the real login validator? >> >> -- >> -- >> Regards, >> Bruce Wade >> http://ca.linkedin.com/in/brucelwade >> http://www.wadecybertech.com >> http://www.warplydesigned.com >> http://www.fitnessfriendsfinder.com >> > > -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com

