diff --git a/gracedb/api/v1/fields.py b/gracedb/api/v1/fields.py index 9d63cf7311c811b640a3483630db730dd1f5c51c..3ccd0565f0f4c0d80b802558302a0a50acbd0d0a 100644 --- a/gracedb/api/v1/fields.py +++ b/gracedb/api/v1/fields.py @@ -4,7 +4,7 @@ import logging from django.utils import six -from rest_framework import fields +from rest_framework import exceptions, fields # Set up logger logger = logging.getLogger(__name__) @@ -124,7 +124,7 @@ class GenericField(fields.Field): error_msg = '{model} with {lf}={data} does not exist' \ .format(model=self.model.__name__, lf=model_dict.keys()[0], data=model_dict.values()[0]) - raise serializers.ValidationError(error_msg) + raise exceptions.ValidationError(error_msg) def get_model_dict(self, data): return {self.lookup_field: data}