mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 19:29:04 +00:00
validate: Allow title to start with lowercase add
This commit is contained in:
@@ -3,10 +3,12 @@ import os
|
||||
|
||||
|
||||
def validate_title(title: str) -> int:
|
||||
if not title.startswith("Add "):
|
||||
prefix_pattern = r"(?i)^add\s+"
|
||||
matched = re.match(prefix_pattern, title)
|
||||
if not matched:
|
||||
return 42
|
||||
|
||||
appid = title[len("Add ") :].strip()
|
||||
appid = title[matched.end() :].strip()
|
||||
regex = r"^[A-Za-z_][\w\-]*$"
|
||||
split = appid.split(".")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user