mosparo / django-integration

This Django app adds the required functionality to use mosparo in your Django form.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Form validation relies on cleaned_data

nijel opened this issue · comments

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.

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.