diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-13 18:30:10 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-13 18:30:10 +0100 |
commit | a22f876356e3f916b535e79bf98fba4dd0d9dbf7 (patch) | |
tree | c58f604af54e2a1eacb5a68b5ffd97e8c78dc6bd /source | |
parent | Typo. (diff) | |
download | newspipe-a22f876356e3f916b535e79bf98fba4dd0d9dbf7.tar.gz newspipe-a22f876356e3f916b535e79bf98fba4dd0d9dbf7.tar.bz2 newspipe-a22f876356e3f916b535e79bf98fba4dd0d9dbf7.zip |
Error messages are displayed with a dedicated function.
Diffstat (limited to 'source')
-rwxr-xr-x | source/pyAggr3g470r.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index d17d100b..b8e5edcd 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -521,12 +521,9 @@ class pyAggr3g470r(object): try: self.mongo.update_feed(feed_id, {"site_link":new_site_url}) tmpl = lookup.get_template("confirmation.html") - message = "<p>The URL of the site has been changed.</p>" + return tmpl.render(message="<p>The URL of the site has been changed.</p>") except: - tmpl = lookup.get_template("error.html") - message = "<p>Error when changing the URL of the site.</p>" - finally: - return tmpl.render(message=message) + return self.error("<p>Error when changing the URL of the site.</p>") change_site_url.exposed = True @@ -539,11 +536,9 @@ class pyAggr3g470r(object): result = utils.change_feed_url(old_feed_url, new_feed_url) if result: tmpl = lookup.get_template("confirmation.html") - message = "<p>The URL of the feed has been changed.</p>" + return tmpl.render("<p>The URL of the feed has been changed.</p>") else: - tmpl = lookup.get_template("error.html") - message = "<p>Error when changing the URL of the feed.</p>" - return tmpl.render(message=message) + return self.error("<p>Error when changing the URL of the feed.</p>") change_feed_url.exposed = True @@ -555,11 +550,9 @@ class pyAggr3g470r(object): 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>" + return tmpl.render("<p>The name of the feed has been changed.</p>") except: - tmpl = lookup.get_template("error.html") - message = "<p>Error when changing the name of the feed.</p>" - return tmpl.render(message=message) + return self.error("<p>Error when changing the name of the feed.</p>") change_feed_name.exposed = True @@ -571,11 +564,9 @@ class pyAggr3g470r(object): try: self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) tmpl = lookup.get_template("confirmation.html") - message = "<p>The logo of the feed has been changed.</p>" + return tmpl.render("<p>The logo of the feed has been changed.</p>") except: - tmpl = lookup.get_template("error.html") - message = "<p>Error when changing the logo of the feed.</p>" - return tmpl.render(message=message) + return self.error("<p>Error when changing the logo of the feed.</p>") change_feed_logo.exposed = True |