Fish Trophy

chipx86 got a fish trophy!

Don't crash if a bad LocalSite ID is posted in a LocalSite-aware form.

Review Request #11111 — Created Aug. 2, 2020 and submitted

Information

Review Board
release-3.0.x

Reviewers

LocalSiteAwareModelFormMixin uses the LocalSite ID passed when
posting form data and validates all other relation fields against that.
An assumption is made that we can perform a query for a LocalSite
given that ID, and on some databases that works fine, but on others it
will raise an exception if the ID isn't numeric.

We now check for this ahead of time and ignore the value if provided,
avoiding a confusing crash.

Unit tests pass.

Verified the crash occurred without this fix but was fixed with it.

Summary ID
Don't crash if a bad LocalSite ID is posted in a LocalSite-aware form.
`LocalSiteAwareModelFormMixin` uses the `LocalSite` ID passed when posting form data and validates all other relation fields against that. An assumption is made that we can perform a query for a `LocalSite` given that ID, and on some databases that works fine, but on others it will raise an exception if the ID isn't numeric. We now check for this ahead of time and ignore the value if provided, avoiding a confusing crash.
e149fa5dd07f6cea7b7845a95fbe3ff00caf7a0e
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (377026e)
Loading...