From c1b05e9bd86bcffb9bf3179aff6b026714c9277e Mon Sep 17 00:00:00 2001 From: John Postlethwait Date: Mon, 26 Mar 2012 17:52:15 -0700 Subject: [PATCH] User needs to log in messages. When a user tries to access a page and they are not logged in, the message needs to be about authentication, NOT authorization as it was before this change. Needing to log in has nothing to do with permissions and the messaging needs to reflect that. Fixes Bug #965810 Change-Id: Ic9de135d4d3d8e7b19524cd100a3fe7ea027e1f4 --- horizon/decorators.py | 13 ++++----- horizon/exceptions.py | 11 +++++++ horizon/locale/es/LC_MESSAGES/django.po | 28 ++++++++++-------- horizon/locale/fr/LC_MESSAGES/django.po | 28 ++++++++++-------- horizon/locale/ja/LC_MESSAGES/django.po | 29 +++++++++++-------- horizon/locale/pl/LC_MESSAGES/django.po | 29 +++++++++++-------- horizon/locale/pt/LC_MESSAGES/django.po | 28 ++++++++++-------- horizon/locale/zh_CN/LC_MESSAGES/django.po | 28 ++++++++++-------- horizon/locale/zh_TW/LC_MESSAGES/django.po | 29 +++++++++++-------- horizon/middleware.py | 3 +- .../locale/es/LC_MESSAGES/django.po | 6 +++- .../locale/fr/LC_MESSAGES/django.po | 6 +++- .../locale/ja/LC_MESSAGES/django.po | 6 +++- .../locale/pl/LC_MESSAGES/django.po | 6 +++- .../locale/pt/LC_MESSAGES/django.po | 6 +++- .../locale/zh_CN/LC_MESSAGES/django.po | 6 +++- .../locale/zh_TW/LC_MESSAGES/django.po | 6 +++- 17 files changed, 168 insertions(+), 100 deletions(-) diff --git a/horizon/decorators.py b/horizon/decorators.py index 73c67e3b5..fd71b80a3 100644 --- a/horizon/decorators.py +++ b/horizon/decorators.py @@ -26,7 +26,7 @@ import functools from django.utils.decorators import available_attrs from django.utils.translation import ugettext as _ -from horizon.exceptions import NotAuthorized, NotFound +from horizon.exceptions import NotAuthorized, NotFound, NotAuthenticated def _current_component(view_func, dashboard=None, panel=None): @@ -44,19 +44,16 @@ def _current_component(view_func, dashboard=None, panel=None): def require_auth(view_func): """ Performs user authentication check. - Similar to Django's `login_required` decorator, except that this - throws NotAuthorized exception if the user is not signed-in. - - Raises a :exc:`~horizon.exceptions.NotAuthorized` exception if the - user is not authenticated. + Similar to Django's `login_required` decorator, except that this throws + :exc:`~horizon.exceptions.NotAuthenticated` exception if the user is not + signed-in. """ @functools.wraps(view_func, assigned=available_attrs(view_func)) def dec(request, *args, **kwargs): if request.user.is_authenticated(): return view_func(request, *args, **kwargs) - raise NotAuthorized(_("You are not authorized to access %s") - % request.path) + raise NotAuthenticated(_("Please log in to continue.")) return dec diff --git a/horizon/exceptions.py b/horizon/exceptions.py index 8e27da74f..31ee1c9ad 100644 --- a/horizon/exceptions.py +++ b/horizon/exceptions.py @@ -63,6 +63,17 @@ class NotAuthorized(HorizonException): status_code = 401 +class NotAuthenticated(HorizonException): + """ + Raised when a user is trying to make requests and they are not logged in. + + The included :class:`~horizon.middleware.HorizonMiddleware` catches + ``NotAuthenticated`` and handles it gracefully by displaying an error + message and redirecting the user to a login page. + """ + status_code = 403 + + class NotFound(HorizonException): """ Generic error to replace all "Not Found"-type API errors. """ status_code = 404 diff --git a/horizon/locale/es/LC_MESSAGES/django.po b/horizon/locale/es/LC_MESSAGES/django.po index 9bddb71b2..f69f4fc45 100644 --- a/horizon/locale/es/LC_MESSAGES/django.po +++ b/horizon/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: openstack-dashboard\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,16 +22,20 @@ msgstr "" msgid "Other" msgstr "" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +msgid "Please log in to continue." +msgstr "" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "" @@ -182,7 +186,7 @@ msgid "Unable to disassociate floating IP." msgstr "" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "" @@ -548,7 +552,7 @@ msgstr "" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -743,7 +747,7 @@ msgid "Image Name" msgstr "" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -897,7 +901,7 @@ msgstr "" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -972,17 +976,17 @@ msgstr "" msgid "Not available" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 msgid "Instance Name" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 msgid "Power State" msgstr "" @@ -2166,7 +2170,7 @@ msgstr "" msgid "Login" msgstr "" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/locale/fr/LC_MESSAGES/django.po b/horizon/locale/fr/LC_MESSAGES/django.po index 711e2eb0d..f4184d070 100644 --- a/horizon/locale/fr/LC_MESSAGES/django.po +++ b/horizon/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: openstack-dashboard\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,16 +22,20 @@ msgstr "" msgid "Other" msgstr "" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +msgid "Please log in to continue." +msgstr "" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "" @@ -182,7 +186,7 @@ msgid "Unable to disassociate floating IP." msgstr "" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "" @@ -548,7 +552,7 @@ msgstr "" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -743,7 +747,7 @@ msgid "Image Name" msgstr "" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -897,7 +901,7 @@ msgstr "" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -972,17 +976,17 @@ msgstr "" msgid "Not available" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 msgid "Instance Name" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 msgid "Power State" msgstr "" @@ -2166,7 +2170,7 @@ msgstr "" msgid "Login" msgstr "" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/locale/ja/LC_MESSAGES/django.po b/horizon/locale/ja/LC_MESSAGES/django.po index 9495ba45b..52acca099 100644 --- a/horizon/locale/ja/LC_MESSAGES/django.po +++ b/horizon/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: openstack-dashboard\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Takeshi Nakajima \n" "Language-Team: LANGUAGE \n" @@ -22,16 +22,21 @@ msgstr "" msgid "Other" msgstr "" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +#, fuzzy +msgid "Please log in to continue." +msgstr "キー%sを削除できません。" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "" @@ -193,7 +198,7 @@ msgid "Unable to disassociate floating IP." msgstr "イメージ%sを更新できません。" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "" @@ -581,7 +586,7 @@ msgstr "ユーザ名" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -797,7 +802,7 @@ msgid "Image Name" msgstr "ユーザ名" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -971,7 +976,7 @@ msgstr "削除" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -1048,18 +1053,18 @@ msgstr "" msgid "Not available" msgstr "現在イメージがありません。" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 #, fuzzy msgid "Instance Name" msgstr "インスタンス" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 #, fuzzy msgid "Power State" @@ -2333,7 +2338,7 @@ msgstr "" msgid "Login" msgstr "" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/locale/pl/LC_MESSAGES/django.po b/horizon/locale/pl/LC_MESSAGES/django.po index ecd301d0b..988971523 100644 --- a/horizon/locale/pl/LC_MESSAGES/django.po +++ b/horizon/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: openstack-dashboard\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: 2011-09-24 14:41+0100\n" "Last-Translator: Tomasz 'Zen' Napierala \n" "Language-Team: Polish OpenStack translations team \n" "Language-Team: LANGUAGE \n" @@ -21,16 +21,20 @@ msgstr "" msgid "Other" msgstr "" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +msgid "Please log in to continue." +msgstr "" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "" @@ -181,7 +185,7 @@ msgid "Unable to disassociate floating IP." msgstr "" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "" @@ -547,7 +551,7 @@ msgstr "" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -742,7 +746,7 @@ msgid "Image Name" msgstr "" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -896,7 +900,7 @@ msgstr "" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -971,17 +975,17 @@ msgstr "" msgid "Not available" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 msgid "Instance Name" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 msgid "Power State" msgstr "" @@ -2165,7 +2169,7 @@ msgstr "" msgid "Login" msgstr "" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/locale/zh_CN/LC_MESSAGES/django.po b/horizon/locale/zh_CN/LC_MESSAGES/django.po index 2bd46c024..65db20de6 100644 --- a/horizon/locale/zh_CN/LC_MESSAGES/django.po +++ b/horizon/locale/zh_CN/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,16 +21,20 @@ msgstr "" msgid "Other" msgstr "" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +msgid "Please log in to continue." +msgstr "" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "" @@ -181,7 +185,7 @@ msgid "Unable to disassociate floating IP." msgstr "" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "" @@ -547,7 +551,7 @@ msgstr "" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -742,7 +746,7 @@ msgid "Image Name" msgstr "" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -896,7 +900,7 @@ msgstr "" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -971,17 +975,17 @@ msgstr "" msgid "Not available" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 msgid "Instance Name" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 msgid "Power State" msgstr "" @@ -2165,7 +2169,7 @@ msgstr "" msgid "Login" msgstr "" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/locale/zh_TW/LC_MESSAGES/django.po b/horizon/locale/zh_TW/LC_MESSAGES/django.po index 50e2b0356..0e429dab3 100644 --- a/horizon/locale/zh_TW/LC_MESSAGES/django.po +++ b/horizon/locale/zh_TW/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Andy Chong \n" "Language-Team: LANGUAGE \n" @@ -21,16 +21,21 @@ msgstr "" msgid "Other" msgstr "其它" -#: decorators.py:58 decorators.py:92 +#: decorators.py:56 +#, fuzzy +msgid "Please log in to continue." +msgstr "無法列出容器。" + +#: decorators.py:89 #, python-format msgid "You are not authorized to access %s" msgstr "您的權限不足 無法查看%s" -#: decorators.py:133 +#: decorators.py:130 msgid "The services for this view are not available." msgstr "這頁面的服務並不存在" -#: exceptions.py:198 +#: exceptions.py:209 msgid "Unauthorized. Please try logging in again." msgstr "權限不足。 請重新登入。" @@ -181,7 +186,7 @@ msgid "Unable to disassociate floating IP." msgstr "無法釋放浮動IP。" #: dashboards/nova/access_and_security/floating_ips/tables.py:91 -#: dashboards/nova/instances_and_volumes/instances/tables.py:224 +#: dashboards/nova/instances_and_volumes/instances/tables.py:228 #: dashboards/syspanel/instances/tables.py:52 msgid "IP Address" msgstr "IP位址" @@ -551,7 +556,7 @@ msgstr "物件" #: dashboards/nova/containers/tables.py:107 #: dashboards/nova/containers/tables.py:171 -#: dashboards/nova/instances_and_volumes/instances/tables.py:225 +#: dashboards/nova/instances_and_volumes/instances/tables.py:229 #: dashboards/nova/instances_and_volumes/volumes/tables.py:113 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:30 #: dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html:29 @@ -746,7 +751,7 @@ msgid "Image Name" msgstr "映像名稱" #: dashboards/nova/images_and_snapshots/images/tables.py:89 -#: dashboards/nova/instances_and_volumes/instances/tables.py:228 +#: dashboards/nova/instances_and_volumes/instances/tables.py:232 #: dashboards/nova/instances_and_volumes/volumes/tables.py:116 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:15 #: dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html:18 @@ -900,7 +905,7 @@ msgstr "已終止執行" #: dashboards/nova/instances_and_volumes/instances/tables.py:69 #: dashboards/nova/instances_and_volumes/instances/tables.py:84 #: dashboards/nova/instances_and_volumes/instances/tables.py:112 -#: dashboards/nova/instances_and_volumes/instances/tables.py:242 +#: dashboards/nova/instances_and_volumes/instances/tables.py:246 #: dashboards/syspanel/instances/panel.py:28 #: dashboards/syspanel/instances/tables.py:70 #: dashboards/syspanel/projects/forms.py:115 @@ -975,17 +980,17 @@ msgstr "%(RAM)s 記憶體 | %(VCPU)s 虛擬處理器 | %(disk)s 磁碟" msgid "Not available" msgstr "不存在" -#: dashboards/nova/instances_and_volumes/instances/tables.py:223 +#: dashboards/nova/instances_and_volumes/instances/tables.py:227 #: dashboards/syspanel/instances/tables.py:51 usage/tables.py:46 msgid "Instance Name" msgstr "執行個體名稱" -#: dashboards/nova/instances_and_volumes/instances/tables.py:232 +#: dashboards/nova/instances_and_volumes/instances/tables.py:236 #: dashboards/syspanel/instances/tables.py:60 msgid "Task" msgstr "工作" -#: dashboards/nova/instances_and_volumes/instances/tables.py:238 +#: dashboards/nova/instances_and_volumes/instances/tables.py:242 #: dashboards/syspanel/instances/tables.py:66 msgid "Power State" msgstr "電源狀態" @@ -2183,7 +2188,7 @@ msgstr "" msgid "Login" msgstr "登入" -#: templates/horizon/common/_data_table.html:29 +#: templates/horizon/common/_data_table.html:31 #, python-format msgid "Displaying %(counter)s item" msgid_plural "Displaying %(counter)s items" diff --git a/horizon/middleware.py b/horizon/middleware.py index 264b0642c..f20c1f09e 100644 --- a/horizon/middleware.py +++ b/horizon/middleware.py @@ -57,7 +57,8 @@ class HorizonMiddleware(object): Catches internal Horizon exception classes such as NotAuthorized, NotFound and Http302 and handles them gracefully. """ - if isinstance(exception, exceptions.NotAuthorized): + if isinstance(exception, + (exceptions.NotAuthorized, exceptions.NotAuthenticated)): auth_url = reverse("horizon:auth_login") next_url = iri_to_uri(request.get_full_path()) if next_url != auth_url: diff --git a/openstack_dashboard/locale/es/LC_MESSAGES/django.po b/openstack_dashboard/locale/es/LC_MESSAGES/django.po index 58e108d8a..cf79bacb5 100644 --- a/openstack_dashboard/locale/es/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,6 +54,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/fr/LC_MESSAGES/django.po b/openstack_dashboard/locale/fr/LC_MESSAGES/django.po index a2b16427a..8477bd9de 100644 --- a/openstack_dashboard/locale/fr/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,6 +54,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/ja/LC_MESSAGES/django.po b/openstack_dashboard/locale/ja/LC_MESSAGES/django.po index 886fcbfc7..34c088e27 100644 --- a/openstack_dashboard/locale/ja/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,6 +54,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/pl/LC_MESSAGES/django.po b/openstack_dashboard/locale/pl/LC_MESSAGES/django.po index 003263e6b..77879a598 100644 --- a/openstack_dashboard/locale/pl/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/pl/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,6 +55,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/pt/LC_MESSAGES/django.po b/openstack_dashboard/locale/pt/LC_MESSAGES/django.po index 58e108d8a..cf79bacb5 100644 --- a/openstack_dashboard/locale/pt/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/pt/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,6 +54,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.po b/openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.po index 9e4fc27da..c6fbf6bdd 100644 --- a/openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,6 +53,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "" diff --git a/openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.po b/openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.po index b1662ab2d..b2bc875cf 100644 --- a/openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.po +++ b/openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-25 13:51-0700\n" +"POT-Creation-Date: 2012-03-26 17:59-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,6 +53,10 @@ msgstr "" msgid "Traditional Chinese" msgstr "" +#: local/local_settings.py:17 +msgid "Your password must be at least 6 characters long." +msgstr "" + #: templates/403.html:4 templates/403.html.py:9 msgid "Forbidden" msgstr "禁止"