[Pkg-debile-commits] [debile-web] 14/16: if the package cannot be found, display a dedicated page
Sylvestre Ledru
sylvestre at alioth.debian.org
Thu Aug 29 10:11:10 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch update-usuability
in repository debile-web.
commit 6dda3abdb9516dc7b3bf48835c44c68bcd1cad78
Author: Sylvestre Ledru <sylvestre at debian.org>
Date: Thu Aug 29 09:54:01 2013 +0200
if the package cannot be found, display a dedicated page
---
debileweb/blueprints/frontend.py | 6 ++++++
templates/source-not-found.html | 9 +++++++++
2 files changed, 15 insertions(+)
diff --git a/debileweb/blueprints/frontend.py b/debileweb/blueprints/frontend.py
index d63d422..514b938 100644
--- a/debileweb/blueprints/frontend.py
+++ b/debileweb/blueprints/frontend.py
@@ -164,6 +164,12 @@ def source(package_name="", owner_name="fred", package_version="latest", run_num
.filter(User.login == owner_name)
versions = sorted(set([e[0] for e in versions_query.all()]))
+ if len(versions) == 0:
+ return render_template('source-not-found.html', **{
+ "package_name": package_name
+ })
+
+
latest_version = versions[-1]
if package_version == 'latest':
this_version = latest_version
diff --git a/templates/source-not-found.html b/templates/source-not-found.html
new file mode 100644
index 0000000..061439f
--- /dev/null
+++ b/templates/source-not-found.html
@@ -0,0 +1,9 @@
+{% extends "base.html" %}
+
+{% block title %}Package not found{% endblock %}
+
+{% block content %}
+
+Package <i>{{ package_name }}</i> not found
+
+{% endblock %}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-web.git
More information about the Pkg-debile-commits
mailing list