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
redirect_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. The
redirect_urisfield must be stored as a
string of space-separated URIs (this is required by
oauth2_provider.models.AbstractApplication). Usually the
ListEditFieldwill take care of converting string inputs into
lists, but this does not happen properly in cases where the widget is not
This change makes the
ApplicationChangeFormtake care of converting the
redirect_urisfield data into a list to ensure that the
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.