From 031e07e2ff2f214043685376057a4e3fec4f3936 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 18 Nov 2023 21:53:13 +1100 Subject: [PATCH] feat: Remove link length limit for admin user --- main.py | 6 +++--- templates/dash.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 058e62e..e77297c 100644 --- a/main.py +++ b/main.py @@ -115,16 +115,16 @@ def add_link(): regexmatch = re.match(r"^https?://([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)(/([a-z0-9.#])+(-([a-z0-9.])+)?)*$", url) if not regexmatch: - return error('Invalid domain') + return error('Invalid destination link') if len(link) > 32: return error('Link too long') - if len(link) < 5: + if len(link) < 5 and domain.lower() != ADMIN_DOMAIN: return error('Link too short') regexmatch = re.match(r"^[a-zA-Z0-9]+$", link) if not regexmatch: - return error('Invalid link') + return error('Invalid link name') # Verify link is not taken if db.get_link(link) != False: diff --git a/templates/dash.html b/templates/dash.html index 916966c..c39007d 100644 --- a/templates/dash.html +++ b/templates/dash.html @@ -96,8 +96,8 @@
-
-
+
+