Commits

Alessandro Molina committed 896db12

Add an hook at save time to make possible to change article values

Comments (0)

Files changed (1)

smallpress/controllers/root.py

     @expose()
     def save(self, *args, **kw):
         article = DBSession.query(Article).get(kw['uid'])
+
+        hooks = config['hooks'].get('smallpress.before_save_article', [])
+        for func in hooks:
+            func(article, kw)
+
         article.title = kw['title']
         article.description = kw['description']
         article.content = kw['content']