toobigtoignore / issf

A global, open-source collaborative database of information on small-scale fisheries.
https://issfcloud.toobigtoignore.net
6 stars 3 forks source link

Form ValidationErrors don't work #245

Open ecumene opened 5 years ago

ecumene commented 5 years ago

For whatever reason, raising a django forms.ValidationError in clean() for any form in details/forms.py does nothing, when it should give you an error on the frontend?

Also, a lot of the validation that goes on in details/views.py does nothing and doesn't work. Take for example like 993 def organization_basic:

if form.is_valid():
   instance = form.save()

#...

   instance.editor_id = request.user.id
   instance.save()

Instance is setup ONLY if form.is_valid(). Yet it's used later when making a new form:

update_tsvector_summary(instance.core_record_type, str(instance.pk))

This sends the frontend back a 500 error, and the backend gets a NoneType has no property... error

Steps to reproduce:

jackharrhy commented 5 years ago

stop cry