From: Michael Tremer Date: Tue, 30 Oct 2018 10:14:58 +0000 (+0000) Subject: fireinfo: Rename profile template X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84b407f03154cf369c8a4720e9635ba377691f8;p=ipfire.org.git fireinfo: Rename profile template Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 211cc000..08308d8f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,7 +142,7 @@ templates_fireinfo_DATA = \ src/templates/fireinfo/index.html \ src/templates/fireinfo/i-use-1.png \ src/templates/fireinfo/model-detail.html \ - src/templates/fireinfo/profile-detail.html \ + src/templates/fireinfo/profile.html \ src/templates/fireinfo/profile-notfound.html \ src/templates/fireinfo/stats-admin.html \ src/templates/fireinfo/stats-cpus-detail.html \ diff --git a/src/templates/fireinfo/profile-detail.html b/src/templates/fireinfo/profile.html similarity index 100% rename from src/templates/fireinfo/profile-detail.html rename to src/templates/fireinfo/profile.html diff --git a/src/web/__init__.py b/src/web/__init__.py index 6097c470..087d2202 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -192,7 +192,7 @@ class Application(tornado.web.Application): # Show profiles (r"/profile/random", fireinfo.RandomProfileHandler), - (r"/profile/([a-z0-9]{40})", fireinfo.ProfileDetailHandler), + (r"/profile/([a-z0-9]{40})", fireinfo.ProfileHandler), # Send profiles. (r"/send/([a-z0-9]+)", fireinfo.ProfileSendHandler), diff --git a/src/web/fireinfo.py b/src/web/fireinfo.py index 7d81e08d..cbecde8f 100644 --- a/src/web/fireinfo.py +++ b/src/web/fireinfo.py @@ -157,15 +157,14 @@ class IndexHandler(BaseHandler): self.render("fireinfo/index.html") -class ProfileDetailHandler(BaseHandler): +class ProfileHandler(BaseHandler): def get(self, profile_id): profile = self.fireinfo.get_profile(profile_id, when=self.when) if not profile or not profile.is_showable(): - self._profile_not_found(profile_id) - return + raise tornado.web.HTTPError(404) - self.render("fireinfo/profile-detail.html", profile=profile) + self.render("fireinfo/profile.html", profile=profile) class RandomProfileHandler(BaseHandler):