wagtail / wagtail-autocomplete

An Autocomplete edit handler for selecting Pages, Snippets, and more.
https://wagtail-autocomplete.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
120 stars 55 forks source link

Handle validation errors raised by `autocomplete_create` method #160

Closed chigby closed 1 year ago

chigby commented 1 year ago

Right now, zero error handling is done when we invoke this method. There are probably a lot of ways we could go about this, but building in handling of validation error (and also returning the results of that error, if there are any), allows users of this feature to use fairly standard Django practices to validate their object before saving and have that be understood by the autocomplete view. One example of how to do this is given in the updated testapp code.

Fixes https://github.com/wagtail/wagtail-autocomplete/issues/134

chigby commented 1 year ago

Added a small error message display on the front-end. Not sure if it's really the best, but, well, it's something. Suggestions welcome. image

chigby commented 1 year ago

Putting back in ready for review.