Merge pull request #153 from DanielGrams/issue/152

BaseOAuth2ClientForm.scopes can not be updated #152
This commit is contained in:
Daniel Grams 2021-03-21 12:47:55 +01:00 committed by GitHub
commit 28b412b5d8
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -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])