From 5c071b749a13c9cbf4d097f5880f17b5c4c171be Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 23 Mar 2023 17:52:31 +0200 Subject: [PATCH] allow polls with the same text --- files/helpers/actions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 6fd49522c..c844f790d 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -507,6 +507,8 @@ def process_poll_options(v:User, target:Union[Submission, Comment]): option_count = 0 + option_objects = [] + for pattern, exclusive in patterns: for i in pattern.finditer(target.body): option_count += 1 @@ -538,4 +540,6 @@ def process_poll_options(v:User, target:Union[Submission, Comment]): body_html=body_html, exclusive=exclusive, ) - g.db.add(option) + option_objects.append(option) + + g.db.add_all(option_objects)