Skip to content

Commit

Permalink
Fill email address if there's a value
Browse files Browse the repository at this point in the history
  • Loading branch information
N-lson committed Oct 11, 2024
1 parent d08c127 commit 2aef89d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion octopusdeploy_framework/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func updateUser(data *schemas.UserTypeResourceModel, user *users.User) {
data.Username = types.StringValue(user.Username)
data.CanPasswordBeEdited = types.BoolValue(user.CanPasswordBeEdited)
data.DisplayName = types.StringValue(user.DisplayName)
if !data.EmailAddress.IsNull() {
if user.EmailAddress != "" {
data.EmailAddress = types.StringValue(user.EmailAddress)
}
data.IsRequestor = types.BoolValue(user.IsRequestor)
Expand Down
3 changes: 1 addition & 2 deletions octopusdeploy_framework/resource_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ func TestAccUserBasic(t *testing.T) {
Config: testAccUserBasic(localName, displayName, isActive, isService, password, username, emailAddress),
},
{
//Config: testAccUserImport(localName, username),
Config: testAccUserImport(localName, username),
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"password"},
ImportStateIdFunc: testAccUserImportStateIdFunc(resourceName),
},
},
})
Expand Down

0 comments on commit 2aef89d

Please sign in to comment.