diff options
| -rw-r--r-- | rest_framework/serializers.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index a983d3fc..8adbafe4 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -327,7 +327,9 @@ class Serializer(BaseSerializer):          Returns a list of validator callables.          """          # Used by the lazily-evaluated `validators` property. -        return getattr(getattr(self, 'Meta', None), 'validators', []) +        meta = getattr(self, 'Meta', None) +        validators = getattr(meta, 'validators', None) +        return validators[:] if validators else []      def get_initial(self):          if hasattr(self, 'initial_data'): @@ -1213,7 +1215,7 @@ class ModelSerializer(Serializer):          # If the validators have been declared explicitly then use that.          validators = getattr(getattr(self, 'Meta', None), 'validators', None)          if validators is not None: -            return validators +            return validators[:]          # Otherwise use the default set of validators.          return ( | 
