Skip to content
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

Form validation relies on cleaned_data #1

Closed
nijel opened this issue Jan 30, 2023 · 1 comment
Closed

Form validation relies on cleaned_data #1

nijel opened this issue Jan 30, 2023 · 1 comment

Comments

@nijel
Copy link

nijel commented Jan 30, 2023

Using cleaned_data for validation is wrong. It contains processed data, so it will fail for anything more complex (for example
ModelChoiceField will have a model instance there,
JSONField will convert JSON string to a matching Python representation).

Problematic code:

res = api_client.verify_submission(form.cleaned_data, submit_token, validation_token)

Instead, it should look at data (and files if mosparo deals with those as well), what is the raw data as submitted in the form.

@zepich
Copy link
Member

zepich commented Jan 30, 2023

Hi @nijel

Thank you very much for your feedback!

I've adjusted the field and changed the used property to data (see 373f0ff)

mosparo does not deal with files since there is no content to check for.

@zepich zepich closed this as completed Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants