From 2f3825d3e2aa75276c8afbcbe7c0e53b13387b42 Mon Sep 17 00:00:00 2001 From: James Turk Date: Tue, 21 Feb 2012 17:00:21 -0500 Subject: [PATCH] add validation of doc_class on insert --- oyster/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oyster/core.py b/oyster/core.py index bb9ce69..2643a4f 100644 --- a/oyster/core.py +++ b/oyster/core.py @@ -94,6 +94,9 @@ class Kernel(object): **kwargs any keyword args will be added to the document's metadata """ + if doc_class not in self.doc_classes: + raise ValueError('unregistered doc_class %s' % doc_class) + tracked = self.db.tracked.find_one({'url': url}) # if data is already tracked and this is just a duplicate call