forked from rDrama/rDrama
WPD: remove poll limit (#51)
by request of the wpd mops Co-authored-by: justcool393 <justcool393@gmail.com> Reviewed-on: rDrama/rDrama#51 Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net> Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>master
parent
6c491b9d11
commit
c12bf5105f
|
@ -619,6 +619,8 @@ elif SITE == 'watchpeopledie.tv':
|
||||||
PERMS['POST_EDITING'] = 2
|
PERMS['POST_EDITING'] = 2
|
||||||
PERMS['ADMIN_ADD'] = 4
|
PERMS['ADMIN_ADD'] = 4
|
||||||
|
|
||||||
|
POLL_MAX_OPTIONS = 0
|
||||||
|
|
||||||
ERROR_TITLES.update({
|
ERROR_TITLES.update({
|
||||||
400: "Bad Request",
|
400: "Bad Request",
|
||||||
401: "Unauthorized",
|
401: "Unauthorized",
|
||||||
|
|
|
@ -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_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]]:
|
def sanitize_poll_type(body:str, re:re.Pattern) -> tuple[str, List[str]]:
|
||||||
opts = []
|
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)))
|
opts.append(filter_emojis_only(i.group(1)))
|
||||||
body = body.replace(i.group(0), "")
|
body = body.replace(i.group(0), "")
|
||||||
return (body, opts)
|
return (body, opts)
|
||||||
|
|
Loading…
Reference in New Issue