From e1b926ad40a412734185ec1012ba3ae203b6e4fb Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Fri, 9 Jul 2010 04:39:23 +0000 Subject: add nice error page when an account no permission to manage any handles svn path=/portal-gui/rpkigui/myrpki/views.py; revision=3372 --- portal-gui/rpkigui/myrpki/views.py | 3 ++- portal-gui/rpkigui/templates/myrpki/conf_empty.html | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 portal-gui/rpkigui/templates/myrpki/conf_empty.html (limited to 'portal-gui') diff --git a/portal-gui/rpkigui/myrpki/views.py b/portal-gui/rpkigui/myrpki/views.py index a2a5a52a..748e1a22 100644 --- a/portal-gui/rpkigui/myrpki/views.py +++ b/portal-gui/rpkigui/myrpki/views.py @@ -31,7 +31,8 @@ def handle_required(f): if conf.count() == 1: handle = conf[0] elif conf.count() == 0: - return http.HttpResponseRedirect('/myrpki/conf/add') + return render('myrpki/conf_empty.html', {}, request) + #return http.HttpResponseRedirect('/myrpki/conf/add') else: # Should reverse the view for this instead of hardcoding # the URL. diff --git a/portal-gui/rpkigui/templates/myrpki/conf_empty.html b/portal-gui/rpkigui/templates/myrpki/conf_empty.html new file mode 100644 index 00000000..0ef9366c --- /dev/null +++ b/portal-gui/rpkigui/templates/myrpki/conf_empty.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} + +

Error!

+

Your account does not have permission to manage any resource handles on this server. Please contact your portal-gui operator. + +{% endblock %} -- cgit v1.2.3