Skip to content

Commit

Permalink
Update the user if they're expected to be inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
N-lson committed Oct 11, 2024
1 parent aaa1e91 commit d1f46a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions octopusdeploy_framework/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func (r *userTypeResource) Create(ctx context.Context, req resource.CreateReques
return
}

// Octopus doesn't allow creating inactive users. To mimic creating an inactive user, we need to update the newly created user.
if !data.IsActive.ValueBool() {
user.IsActive = data.IsActive.ValueBool()
user, err = users.Update(r.Config.Client, user)
}

updateUser(&data, user)
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
}
Expand Down

0 comments on commit d1f46a2

Please sign in to comment.