Refactor is_safe_name and read_app_info functions for improved readability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
ce60fc8f5c
commit
3b48f38d89
1 changed files with 18 additions and 18 deletions
|
|
@ -407,11 +407,11 @@ INDEX_HTML = """<!doctype html>
|
|||
"""
|
||||
|
||||
|
||||
def is_safe_name(name):
|
||||
def is_safe_name(name):
|
||||
return re.match(r"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$", name) is not None
|
||||
|
||||
|
||||
def read_app_info(name):
|
||||
def read_app_info(name):
|
||||
if not is_safe_name(name):
|
||||
return None, {"ok": False, "error": "invalid app name"}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue