From 9e276c3ffb95d80a55f4bc505dbfc2d4ce2255a0 Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Sun, 27 Oct 2013 17:41:19 -0500 Subject: [PATCH] Undo this change, bad idea. English letters do not always sort as expected in non-en locales. --- modules/installed/system/config.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/installed/system/config.py b/modules/installed/system/config.py index 67d2b8e6d..758a33c9c 100644 --- a/modules/installed/system/config.py +++ b/modules/installed/system/config.py @@ -40,7 +40,7 @@ def valid_hostname(name): if not is_alphanumeric(name): message += "
Hostname must be alphanumeric" - if not bool(re.match("A-z", name[0])): + if not name[0] in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ": message += "
Hostname must start with a letter" return message @@ -53,19 +53,18 @@ def set_hostname(hostname): cfg.log.info("Changing hostname to '%s'" % hostname) try: privilegedaction_run("hostname-change", [hostname]) - except OSError, e: - raise cherrypy.HTTPError(500, "Updating hostname failed: %s" % e) - else: # don't persist/cache change unless it was saved successfuly sys_store = filedict_con(cfg.store_file, 'sys') sys_store['hostname'] = hostname + except OSError, e: + raise cherrypy.HTTPError(500, "Updating hostname failed: %s" % e) class general(FormPlugin, PagePlugin): url = ["/sys/config"] order = 30 def help(self, *args, **kwargs): - return _(#"""Time Zone + return _(#"""Time Zone """

Set your timezone to get accurate timestamps. %(product)s will use this information to set your %(box)s's systemwide timezone.

@@ -109,8 +108,8 @@ class general(FormPlugin, PagePlugin): raise cherrypy.HTTPError(500, "Unknown Time Zone: %s" % kwargs['time_zone']) ## And now, the form. - form = Form(title=_("General Config"), - action="/sys/config/general/index", + form = Form(title=_("General Config"), + action="/sys/config/general/index", name="config_general_form", message=message ) form.html(self.help()) @@ -142,3 +141,4 @@ class general(FormPlugin, PagePlugin): privilegedaction_run("timezone-change", [time_zone]) sys_store['time_zone'] = time_zone return message or "Settings updated." +