changeset 4918:9953cf1cec5b

action language_setup: error messages added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 27 Jul 2009 00:10:05 +0200
parents 3a1c45643a6a
children de6598662f6a
files MoinMoin/action/language_setup.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/language_setup.py	Mon Jul 27 00:15:51 2009 +0200
+++ b/MoinMoin/action/language_setup.py	Mon Jul 27 00:10:05 2009 +0200
@@ -20,13 +20,21 @@
 from MoinMoin.widget.browser import DataBrowserWidget
 
 def execute(pagename, request):
+    _ = request.getText
     if not request.user or not request.user.isSuperUser():
+        msg = _('Only superuser is allowed to use this action.')
+        request.theme.add_msg(msg, "error")
+        request.page.send_page()
         return ''
-    _ = request.getText
     fmt = request.html_formatter
     language_setup_page = 'LanguageSetup'
     not_translated_system_pages = 'not_translated_system_pages.zip'
     files = AttachFile._get_files(request, language_setup_page)
+    if not files:
+        msg = _('No page packages found.')
+        request.theme.add_msg(msg, "error")
+        request.page.send_page()
+        return ''
     wiki_languages = list(set([lang_file.split('_')[0] for lang_file in files]) - set(['00']))
     wiki_languages.sort()