Browse Source

Trim leading/trailing whitespace on topic links

merge-requests/88/head
Deimos 5 years ago
parent
commit
35f3135742
  1. 5
      tildes/tildes/schemas/topic.py

5
tildes/tildes/schemas/topic.py

@ -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

Loading…
Cancel
Save