import db
import logging

from ckan.plugins.toolkit import get_validator
import ckan.lib.navl.dictization_functions as df

log = logging.getLogger(__name__)

schema = {
    'id': [get_validator('ignore_empty'), unicode],
    'address': [get_validator('not_empty'), unicode],
    'topic': [get_validator('not_empty'), unicode],
    'user_id': [get_validator('ignore_missing'), unicode],
    'created_at': [get_validator('ignore_missing'), get_validator('isodate')]
}

def webhook_create(context, data_dict):
    log.info(data_dict)

    data, errors = df.validate(data_dict, schema, context)

def webhook_delete(context, data_dict):
    pass

@@ -65,16 +65,33 @@
 alidator
+, ValidationError
 %0Aimport 
@@ -602,16 +602,70 @@
 ntext)%0A%0A
+    if errors:%0A        raise ValidationError(errors)%0A%0A
 def webh

raise error on validation