Merge pull request #1368 from AlanCoding/none_client

Fix server error with absent client_secret
This commit is contained in:
Alan Rominger 2018-02-27 10:39:50 -05:00 committed by GitHub
commit 6d7f60ea61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -998,7 +998,7 @@ class OAuth2ApplicationSerializer(BaseSerializer):
def to_representation(self, obj):
ret = super(OAuth2ApplicationSerializer, self).to_representation(obj)
if obj.client_type == 'public':
ret.pop('client_secret')
ret.pop('client_secret', None)
return ret