fixed empty tag form submission
authorNick Retallack <nickretallack@gmil.com>
Tue, 6 Oct 2009 17:47:43 +0000 (10:47 -0700)
committerNick Retallack <nickretallack@gmil.com>
Tue, 6 Oct 2009 17:47:43 +0000 (10:47 -0700)
floof/controllers/art.py

index f08cd60..a0aecd7 100644 (file)
@@ -38,9 +38,10 @@ class ArtController(BaseController):
         return render("/art/show.mako")
         
     # TODO: login required
         return render("/art/show.mako")
         
     # TODO: login required
+    # also, require post
     def tag(self, id):
         # c.art = h.get_object_or_404(Art, id=id)
     def tag(self, id):
         # c.art = h.get_object_or_404(Art, id=id)
-        c.art.add_tags(request.params["tags"], c.user)
+        c.art.add_tags(request.params.get("tags",""), c.user)
         elixir.session.commit()
         redirect_to('show_art', id=c.art.id)
     
         elixir.session.commit()
         redirect_to('show_art', id=c.art.id)