add validation of doc_class on insert

This commit is contained in:
James Turk 2012-02-21 17:00:21 -05:00
parent 211e40e211
commit 2f3825d3e2

View File

@ -94,6 +94,9 @@ class Kernel(object):
**kwargs **kwargs
any keyword args will be added to the document's metadata 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}) tracked = self.db.tracked.find_one({'url': url})
# if data is already tracked and this is just a duplicate call # if data is already tracked and this is just a duplicate call