mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-26 11:03:45 +03:00
Merge pull request #100 from philippeluickx/master
allow_blank required for optional paramaters in serializers
This commit is contained in:
commit
316d5c4233
|
@ -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')
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user