mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 18:51:06 -03:30
Merge pull request #1964 from ryanpetrello/fix-token-scope
fix a few minor issues that have broken the User Token creation
This commit is contained in:
@@ -1073,7 +1073,7 @@ class UserAuthorizedTokenSerializer(BaseOAuth2TokenSerializer):
|
|||||||
validated_data['expires'] = now() + timedelta(
|
validated_data['expires'] = now() + timedelta(
|
||||||
seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS']
|
seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS']
|
||||||
)
|
)
|
||||||
obj = super(OAuth2TokenSerializer, self).create(validated_data)
|
obj = super(UserAuthorizedTokenSerializer, self).create(validated_data)
|
||||||
obj.save()
|
obj.save()
|
||||||
if obj.application is not None:
|
if obj.application is not None:
|
||||||
RefreshToken.objects.create(
|
RefreshToken.objects.create(
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ function AddTokensController (
|
|||||||
required: true,
|
required: true,
|
||||||
_component: 'at-input-select',
|
_component: 'at-input-select',
|
||||||
_data: [
|
_data: [
|
||||||
strings.get('add.SCOPE_PLACEHOLDER'),
|
{ label: strings.get('add.SCOPE_PLACEHOLDER'), value: '' },
|
||||||
strings.get('add.SCOPE_READ_LABEL'),
|
{ label: strings.get('add.SCOPE_READ_LABEL'), value: 'read' },
|
||||||
strings.get('add.SCOPE_WRITE_LABEL')
|
{ label: strings.get('add.SCOPE_WRITE_LABEL'), value: 'write' }
|
||||||
],
|
],
|
||||||
_exp: 'choice for (index, choice) in state._data',
|
_exp: 'choice.value as choice.label for (index, choice) in state._data',
|
||||||
_format: 'array'
|
_format: 'array'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user