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
ListEditWidget
has 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
ListEditWidget
for itsredirect_uris
field. 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_uris
field must be stored as a
string of space-separated URIs (this is required by
oauth2_provider.models.AbstractApplication
). Usually theListEditWidget
and
correspondingListEditField
will 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
ApplicationChangeForm
take care of converting the
redirect_uris
field data into a list to ensure that theredirect_uris
data
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 |