aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorDanilo Bargen2013-02-26 09:38:57 +0100
committerDanilo Bargen2013-02-26 09:38:57 +0100
commite476dcb8c70f3792f01214f8d4a13c9316e11341 (patch)
treea888565d479df6aec2e38b80a9b4f0650095a8af /rest_framework/serializers.py
parentec4d79bcaf08d577e8c44cad873515d018e21986 (diff)
downloaddjango-rest-framework-e476dcb8c70f3792f01214f8d4a13c9316e11341.tar.bz2
Changed AttributeError to AssertionError
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index d57417d9..91af2af2 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -424,9 +424,8 @@ class ModelSerializer(Serializer):
"""
cls = self.opts.model
- if cls is None:
- raise AttributeError("Serializer class '%s' is missing 'model' Meta option" %
- self.__class__.__name__)
+ assert cls is not None, \
+ "Serializer class '%s' is missing 'model' Meta option" % self.__class__.__name__
opts = get_concrete_model(cls)._meta
pk_field = opts.pk
# while pk_field.rel: