def validate(self, data): """ Validating user's data. :param data: :return: Validated data. """ check_valid_password(data) self.check_valid_email(data['email']) return data
def validate(self, data): email = data.get('email') if email and 'email' in data: data['email'] = email.lower() data['username'] = data['email'] if 'email' in data: self.check_valid_email(data['email'], self.context['request'].user.pk) check_valid_password(data, user=self.context['request'].user) return data
def validate(self, data): check_valid_password(data) self.check_valid_token() return data
def validate(self, data): check_valid_password(data) self.check_valid_email(data['email']) return data
def validate(self, data): error = check_valid_password(data) if error: raise serializers.ValidationError({'password': error}) return data