Don't attempt to add errors to a form that's empty
authorMagnus Hagander <magnus@hagander.net>
Mon, 19 Feb 2018 09:32:30 +0000 (10:32 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 19 Feb 2018 09:32:30 +0000 (10:32 +0100)
commit796ee84a06ff03848dba1d7d3b7a10ba1f3148da
tree67ce59cbf5beaed3add57e7b9adfa1f3a5781d73
parent701cc93a86e6b970de9596deeb26310bc8747c99
Don't attempt to add errors to a form that's empty

The add_error method of a form will fail if is_valid() has not been
called. So only add the errors in this case -- which means that finalize
was picked. Since this is just the invoice form it's not an issue (it's
a catch-all error path which will only be called if something passed
verification earlier but is now no longer valid, such as an expired
discount code)
postgresqleu/confreg/views.py