Did you also include form.custom.begin and form.custom.end (you need the
latter, or the _formkey check will fail silently)? Anyway, if you just want
to exclude some fields from the register form, you can set the readable and
writable attributes to False within the user function:
def user():
if request.args(0) == 'register':
for field in [list, of, fields]:
db.auth_user[field].readable = db.auth_user[field].writable =
False
On Friday, September 6, 2013 5:17:23 PM UTC-4, Apple Mason wrote:
>
> The default register form has too many fields, so I created a slimmed-down
> custom one:
>
> register.html:
>
> <div>
> Username: {{=form.custom.widget.username}}
> Email: {{=form.custom.widget.email}}
> Password: {{=form.custom.widget.password}}
>
> {{=form.custom.submit}}
> </div>
>
> default.py:
>
> def register():
> return dict(form=auth.register())
>
> def login():
> return dict(form=auth.login())
>
> The default validation works if you submit an invalid input (ie, an
> invalid email will error on the form). But if the information is correct,
> the information doesn't get saved into the database, so the user is never
> created.
>
> I thought maybe doing something like:
>
> form = auth.register()
> if form.process().accepted:
> # Then what??
>
> But that seems incorrect because it looks like it'll process the form
> twice.
>
> What's the proper way of handling user actions on custom forms? ie, login,
> registration, request_reset_password...
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.