Skip to content

Commit a65303f

Browse files
committed
If noone is a lead, everyone is
- Syndrome from the Incredibles, or something
1 parent 79fe73a commit a65303f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/syncengine/syncengine.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"fmt"
1010
"regexp"
1111

12+
"github.com/lukegb/mattermost-plugin-uffd/server/ctxlog"
1213
"github.com/lukegb/mattermost-plugin-uffd/server/stringset"
1314
)
1415

@@ -116,6 +117,8 @@ func (s *SyncEngine) FullSyncUsers(ctx context.Context, c *Cache, out *Outcome)
116117
}
117118

118119
func (s *SyncEngine) FullSyncGroups(ctx context.Context, c *Cache, out *Outcome) error {
120+
l := ctxlog.FromContext(ctx)
121+
119122
idpGroups, err := s.IDP.FetchGroups(ctx)
120123
if err != nil {
121124
return err
@@ -193,7 +196,8 @@ func (s *SyncEngine) FullSyncGroups(ctx context.Context, c *Cache, out *Outcome)
193196
var teams []Team
194197
for _, teamData := range teamDatas {
195198
if teamData.leadsGroup == nil {
196-
return fmt.Errorf("team %v missing a leads group", teamData.name)
199+
l.WithField("team", teamData.name).Warningf("team %s missing a leads group; using members group as leads group", teamData.name)
200+
teamData.leadsGroup = teamData.membersGroup
197201
}
198202
if teamData.membersGroup == nil {
199203
return fmt.Errorf("team %v missing a members group", teamData.name)

0 commit comments

Comments
 (0)