mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-17 06:48:36 +02:00
Trim leading/trailing whitespace on topic links
This commit is contained in:
@@ -113,8 +113,11 @@ class TopicSchema(Schema):
|
||||
if "link" not in data:
|
||||
return data
|
||||
|
||||
# remove leading/trailing whitespace
|
||||
data["link"] = data["link"].strip()
|
||||
|
||||
# if the value is empty, convert it to None
|
||||
if not data["link"] or data["link"].isspace():
|
||||
if not data["link"]:
|
||||
data["link"] = None
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user