diff --git a/project/forms/oauth2_client.py b/project/forms/oauth2_client.py index 2f3f265..2a28504 100644 --- a/project/forms/oauth2_client.py +++ b/project/forms/oauth2_client.py @@ -77,8 +77,9 @@ class BaseOAuth2ClientForm(FlaskForm): if not obj: return - self.redirect_uris.data = os.linesep.join(obj.redirect_uris) - self.scope.data = obj.scope.split(" ") + formdata = self.meta.wrap_formdata(self, formdata) + self.redirect_uris.process(formdata, os.linesep.join(obj.redirect_uris)) + self.scope.process(formdata, obj.scope.split(" ")) class CreateOAuth2ClientForm(BaseOAuth2ClientForm): diff --git a/tests/views/test_oauth2_client.py b/tests/views/test_oauth2_client.py index 330acb8..01eb2c1 100644 --- a/tests/views/test_oauth2_client.py +++ b/tests/views/test_oauth2_client.py @@ -78,6 +78,7 @@ def test_update(client, seeder, utils, app, mocker, db_error): response, { "client_name": "Neuer Name", + "redirect_uris": "localhost:1337\nlocalhost:1338", }, ) @@ -92,6 +93,7 @@ def test_update(client, seeder, utils, app, mocker, db_error): oauth2_client = OAuth2Client.query.get(oauth2_client_id) assert oauth2_client.client_name == "Neuer Name" + assert oauth2_client.redirect_uris == ["localhost:1337", "localhost:1338"] @pytest.mark.parametrize("db_error", [True, False])