FIX: prevents everyone group to show as group option for polls (#8957)

FIX: prevents everyone group to show as group option for polls (#8957)

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 6eda7b490d..e5ca3d05d6 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")

GitHub sha: 2c7d32e7

1 Like

This commit appears in #8957 which was merged by @jjaffeux.