From d26ddd2ee04d72645da701905e4bab911dafdde6 Mon Sep 17 00:00:00 2001 From: StruckCroissant Date: Mon, 7 Feb 2022 12:04:38 -0600 Subject: [PATCH] Stripping whitespace from posted channel names --- modules/videos/channel/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/videos/channel/api.py b/modules/videos/channel/api.py index 07d8169a..55f365ea 100644 --- a/modules/videos/channel/api.py +++ b/modules/videos/channel/api.py @@ -49,7 +49,10 @@ def channel_post(_: Request, body: schema.ChannelPostRequest): if not body.directory.is_dir() and body.mkdir: make_media_directory(body.directory) - channel = lib.create_channel(body.__dict__) # TODO don't use the dataclass as a dict. + bd_edit = body.__dict__ + bd_edit['name'] = bd_edit['name'].strip() + channel = lib.create_channel(bd_edit) # TODO don't use the dataclass as a dict. + print(channel) # Refresh the videos asynchronously from ..api import refresh_videos