Commit 0f04d57f authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Bugfix to event graceid fields error handling in API

parent 36259706
Pipeline #51460 passed with stages
in 5 minutes and 11 seconds
......@@ -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],
raise serializers.ValidationError(error_msg)
raise exceptions.ValidationError(error_msg)
def get_model_dict(self, data):
return {self.lookup_field: data}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment