Commits

Anonymous committed 4a035a8

Added check to avoid exceptions on bad parameters sent to /save

  • Participants
  • Parent commits 452b590

Comments (0)

Files changed (1)

File smallpress/controllers/root.py

 
     @require(predicates.in_group('smallpress'))
     @expose('genshi:smallpress.templates.edit')
-    def edit(self, uid, *args, **kw):
+    def edit(self, uid=None, *args, **kw):
+        if not uid:
+            return redirect(plug_url('smallpress', '/'))
         inject_datagrid_resources(attachments_table)
 
         article = DBSession.query(Article).get(uid)
     @validate(get_article_form(), error_handler=edit)
     @expose()
     def save(self, *args, **kw):
+        print args, kw
         article = DBSession.query(Article).get(kw['uid'])
 
         hooks = config['hooks'].get('smallpress.before_save_article', [])