1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

remove validate_mysql_user_host (#7105)

This commit is contained in:
欢乐马
2024-11-26 16:02:33 +08:00
committed by GitHub
parent 0d8e198ab1
commit 6543dd3bb8

View File

@@ -420,9 +420,6 @@ Please choose a way to initialize seafile databases:
validate=validate)
def validate_mysql_host(self, host):
if not re.match(r'^[a-zA-Z0-9_\-\.]+$', host):
raise InvalidAnswer('%s is not a valid host' % Utils.highlight(host))
if host == 'localhost':
host = '127.0.0.1'
return host
@@ -437,9 +434,6 @@ Please choose a way to initialize seafile databases:
validate=self.validate_mysql_host)
def validate_mysql_user_host(self, host):
MYSQL_HOST_RE = re.compile(r'^(%|[^.].+\..+[^.])$')
if not MYSQL_HOST_RE.match(host):
raise InvalidAnswer('invalid mysql user host: {}'.format(host))
return host
def ask_mysql_user_host(self):