changeset 4921:de6598662f6a

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 27 Jul 2009 01:27:31 +0200
parents 0e94e9b438be (current diff) 9953cf1cec5b (diff)
children 4ae10b1a4e20
files
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/language_setup.py	Mon Jul 27 01:26:54 2009 +0200
+++ b/MoinMoin/action/language_setup.py	Mon Jul 27 01:27:31 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()