Fix problems between the redirect URIs field and ListEditWidget in OAuth Application forms
Review Request #12347 — Created June 9, 2022 and submitted
Recent updates to Djblet's
ListEditWidgethas caused Reviewboard's OAuth App
API to fail on POST and PUT requests because the OAuth App API wraps the OAuth
ApplicationChangeForm, which relies on the legacy behavior of the
ListEditWidgetfor itsredirect_urisfield. The legacy behavior of the
widget is to take in a string and split it into a list, as opposed to the modern
behavior of taking in a list. Theredirect_urisfield must be stored as a
string of space-separated URIs (this is required by
oauth2_provider.models.AbstractApplication). Usually theListEditWidgetand
correspondingListEditFieldwill take care of converting string inputs into
lists, but this does not happen properly in cases where the widget is not
rendered.This change makes the
ApplicationChangeFormtake care of converting the
redirect_urisfield data into a list to ensure that theredirect_urisdata
is properly passed to the widget's methods and saved to the form in cases
where the widget is not rendered.
- Ran OAuth Unit tests.
- Ran OAuth App API Unit tests.
- Manually tested the OAuth Application form in the admin settings UI.
| Summary | ID |
|---|---|
| 8ae337ae7c7e4bdc196f0f42ac05a84413016101 |