Merge pull request #100 from philippeluickx/master

allow_blank required for optional paramaters in serializers
This commit is contained in:
Mateusz Sikora 2015-08-17 12:37:33 +02:00
commit 316d5c4233
2 changed files with 4 additions and 4 deletions

View File

@ -10,8 +10,8 @@ except ImportError:
class SocialLoginSerializer(serializers.Serializer):
access_token = serializers.CharField(required=False)
code = serializers.CharField(required=False)
access_token = serializers.CharField(required=False, allow_blank=True)
code = serializers.CharField(required=False, allow_blank=True)
def _get_request(self):
request = self.context.get('request')

View File

@ -15,8 +15,8 @@ from rest_framework.exceptions import ValidationError
class LoginSerializer(serializers.Serializer):
username = serializers.CharField(required=False)
email = serializers.EmailField(required=False)
username = serializers.CharField(required=False, allow_blank=True)
email = serializers.EmailField(required=False, allow_blank=True)
password = serializers.CharField(style={'input_type': 'password'})
def validate(self, attrs):