add validation of doc_class on insert
This commit is contained in:
parent
211e40e211
commit
2f3825d3e2
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user