-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a marshmallow schema for regfom submissions #18
Use a marshmallow schema for regfom submissions #18
Conversation
indico/modules/events/registration/controllers/management/reglists.py
Outdated
Show resolved
Hide resolved
e187749
to
ae795e3
Compare
not implemented anywhere in the new react code, so i'd just ignore that for now |
for field validation you could just pass |
a69e832
to
baa6041
Compare
indico/modules/events/registration/controllers/management/reglists.py
Outdated
Show resolved
Hide resolved
# Some field validators require access to the previous registration | ||
schema[form_item.html_field_name] = field_impl.create_mm_field(registration=registration) | ||
|
||
# TODO: what to do with signal -> signals.event.registration_form_wtform_created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indico#4642 for the rationale why it was added - so I think in the end we should probably provide a similar signal that has access to the schema in order to modify that one if needed. But I think we could consider getting rid of it; if the UN folks (cc @OmeGak) still need it when adapting to the react regform (I'd still like to provide some way for plugins to register new regform field types!) we can see what's the best way of restoring it (or let them send another PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are, indeed, still needing this signal (or something equivalent). You can see here how we are using it:
https://github.com/UNOG-Indico/indico-un/blob/master/un/modules/registration/forms.py#L60-L61
baa6041
to
9e879d5
Compare
2638bca
to
2bc9855
Compare
d53acfe
to
f28f812
Compare
955b5ff
to
10832f2
Compare
f28f812
to
1803c46
Compare
1803c46
to
e44f1e2
Compare
On errors, the webargs parser responds with 422. This is picked up in js by handleSubmitError which displays the error in the corresponding final-form.
ee5b276
to
a8d8aef
Compare
indico/modules/events/registration/client/js/form/fields/BooleanInput.jsx
Outdated
Show resolved
Hide resolved
9e73ae3
to
3e3ab7e
Compare
3e3ab7e
to
78390ba
Compare
Adds
mm_field_class
andmm_field_kwargs
toRegistrationFormFieldBase
which are used to dynamically construct the regform schema.
What works:
validators
into the marshmallow schemaWhat doesn't work yet: