From 2c7d32e78310fde29868451fb281edb263aaf4c8 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 14 Feb 2020 14:11:34 +0100 Subject: [PATCH] FIX: prevents everyone group to show as group option for polls (#8957) --- .../javascripts/controllers/poll-ui-builder.js.es6 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 index 6eda7b490de..e5ca3d05d63 100644 --- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -87,9 +87,14 @@ export default Controller.extend({ @discourseComputed("site.groups") siteGroups(groups) { - return groups.map(g => { - return { name: g.name, value: g.name }; - }); + return groups + .map(g => { + // prevents group "everyone" to be listed + if (g.id !== 0) { + return { name: g.name, value: g.name }; + } + }) + .filter(Boolean); }, @discourseComputed("pollType", "regularPollType")