When signature is invalid we default back to anonymous account. this can confuse users (e.g. when they are trying to sign an ofd memo). instead we should display the usual "Errors Detected" form validation and say something like "Signature is invalid. Try signing latest preview data or delete signature to be anonymous."
This should probably use add_errorhttps://docs.djangoproject.com/en/2.2/ref/forms/api/#django.forms.Form.add_error because making it a regular field validator seems to be impossible because this check requires access to multiple fields. We could also make it a non-field error yet that will not highlight the sig text box.
When signature is invalid we default back to anonymous account. this can confuse users (e.g. when they are trying to sign an ofd memo). instead we should display the usual "Errors Detected" form validation and say something like "Signature is invalid. Try signing latest preview data or delete signature to be anonymous."
This should probably use
add_error
https://docs.djangoproject.com/en/2.2/ref/forms/api/#django.forms.Form.add_error because making it a regular field validator seems to be impossible because this check requires access to multiple fields. We could also make it a non-field error yet that will not highlight the sig text box.This is blocked by migration to Django 2 or 3, because 1.6 does not have
add_error
in forms https://django.readthedocs.io/en/1.6.x/intro/tutorial01.html