From c12bf5105f981f8a7c0ac8f09f50c5ab83966fdd Mon Sep 17 00:00:00 2001 From: justcool393 Date: Tue, 6 Dec 2022 18:24:41 +0000 Subject: [PATCH] WPD: remove poll limit (#51) by request of the wpd mops Co-authored-by: justcool393 Reviewed-on: https://fsdfsd.net/rDrama/rDrama/pulls/51 Co-authored-by: justcool393 Co-committed-by: justcool393 --- files/helpers/const.py | 2 ++ files/helpers/sanitize.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 0697f1fe9..00eba309b 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -619,6 +619,8 @@ elif SITE == 'watchpeopledie.tv': PERMS['POST_EDITING'] = 2 PERMS['ADMIN_ADD'] = 4 + POLL_MAX_OPTIONS = 0 + ERROR_TITLES.update({ 400: "Bad Request", 401: "Unauthorized", diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 820abc771..fa4072a45 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -499,7 +499,7 @@ def validate_css(css): def sanitize_poll_options(v:User, body:str, allow_bets:bool) -> tuple[str, List[Any], List[Any], List[Any]]: def sanitize_poll_type(body:str, re:re.Pattern) -> tuple[str, List[str]]: opts = [] - for i in list(re.finditer(body))[:POLL_MAX_OPTIONS]: + for i in list(re.finditer(body))[:POLL_MAX_OPTIONS] if POLL_MAX_OPTIONS else list(re.finditer(body)): opts.append(filter_emojis_only(i.group(1))) body = body.replace(i.group(0), "") return (body, opts)