fix server error with absent client_secret

This commit is contained in:
AlanCoding
2018-02-27 09:23:36 -05:00
parent c3968ca2b6
commit c900027f82

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