One minor correction to the data below, web2py is not saving a space from mssql but, is instead, saving the empty string to mssql and *reading* the empty string as a space from mssql and then the if test evaluates to true.
On Oct 14, 10:59 am, bm <[email protected]> wrote: > There's a problem while registering a user when web2py is using > mssql. > > Here are the pertinent pieces to reproduce the problem: > > - web2py version = 1.67.2 > - web2py connected to mssql via pyodbc and freetds > - registration_requires_verification = True > - registration_requires_approval = False > - email verification link has been clicked and clears registration_key > from the database (confirmed by looking at field directly in the > database) > > Upon a successive logout and log back in, logging in still requires > email verification. After some time troubleshooting, I found that > web2py, although it's setting registration_key = '' (empty string) in > verify_email() (line 1018 in v.1.67.2), is actually saving a space in > mssql. Thus, when registration_key is being evaluated upon login > (tools.py lines 771-781 in v.1.67.2), line 778 in tools.py: > > elif temp_user.registration_key > > is evaluating space as something and therefore the if condition > evaluates to true and causes: > response.flash = \ > self.messages.registration_verifying > > to trigger in a situation that registration_key should be evaluating > to false and thus, bypassing the "requires verification" and allowing > the user to log back in. > > For a temporary fix, I've changed line 778 to: > > elif temp_user.registration_key.strip() > > which resolves this specific problem. But, I still have the wonder in > my mind what other areas of the framework may be affected by this same > problem. > > Any Ideas?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

