@@ -50,21 +50,21 @@ func (s AGPLIDPSync) GroupSyncSettings(ctx context.Context, orgID uuid.UUID, db
50
50
51
51
// Default to not being configured
52
52
settings = & GroupSyncSettings {}
53
- }
54
53
55
- // Check for legacy settings if the default org.
56
- if s .DeploymentSyncSettings .Legacy .GroupField != "" && settings .Field == "" {
57
- defaultOrganization , err := db .GetDefaultOrganization (ctx )
58
- if err != nil {
59
- return nil , xerrors .Errorf ("get default organization: %w" , err )
60
- }
61
- if defaultOrganization .ID == orgID {
62
- settings = ptr .Ref (GroupSyncSettings (codersdk.GroupSyncSettings {
63
- Field : s .Legacy .GroupField ,
64
- LegacyNameMapping : s .Legacy .GroupMapping ,
65
- RegexFilter : s .Legacy .GroupFilter ,
66
- AutoCreateMissing : s .Legacy .CreateMissingGroups ,
67
- }))
54
+ // Check for legacy settings if the default org.
55
+ if s .DeploymentSyncSettings .Legacy .GroupField != "" {
56
+ defaultOrganization , err := db .GetDefaultOrganization (ctx )
57
+ if err != nil {
58
+ return nil , xerrors .Errorf ("get default organization: %w" , err )
59
+ }
60
+ if defaultOrganization .ID == orgID {
61
+ settings = ptr .Ref (GroupSyncSettings (codersdk.GroupSyncSettings {
62
+ Field : s .Legacy .GroupField ,
63
+ LegacyNameMapping : s .Legacy .GroupMapping ,
64
+ RegexFilter : s .Legacy .GroupFilter ,
65
+ AutoCreateMissing : s .Legacy .CreateMissingGroups ,
66
+ }))
67
+ }
68
68
}
69
69
}
70
70
0 commit comments