vegphilly/vegphilly.com — pull request #262 by steventlamb (2013-08-17 22:56:01+00:00)
Title: Add vendor/review/vegan_dish m2m validation

Fixes #155 on github.

When deleting a vegan_dish, the framework/db won't prevent you from
nulling out the best_vegan_dish on a review because few of these
fields are required. This commit adds a signal receiver that will
intercept changes to the m2m relationship of vendor<->vegan_dish. If a
vendor has reviews with non-null best_vegan_dishes, an IntegrityError
is raised. Extra validation was added to prevent the dreaded clear()
method as well.