Commits

Cédric Bonhomme  committed 1a67e1d

Handle exception in change_feed_name().

  • Participants
  • Parent commits 0e25312

Comments (0)

Files changed (1)

File source/pyAggr3g470r.py

         """
         Enables to change the name of a feed.
         """
-        self.mongo.update_feed(feed_id, {"feed_title":new_feed_name})
-        tmpl = lookup.get_template("confirmation.html")
-        return tmpl.render(message="<p>The name of the feed has been changed.</p>")
+        try:
+            self.mongo.update_feed(feed_id, {"feed_title":new_feed_name})
+            tmpl = lookup.get_template("confirmation.html")
+            message = "<p>The name of the feed has been changed.</p>"
+        except:
+            tmpl = lookup.get_template("error.html")
+            message = "<p>Error when changing the nameL of the feed.</p>"
+        return tmpl.render(message=message)
 
     change_feed_name.exposed = True