Skip to content

Commit

Permalink
Fix usage of object_type on contact_assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jul 12, 2024
1 parent 90fb96a commit 0f1b004
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netbox/resource_netbox_contact_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ func resourceNetboxContactAssignmentRead(d *schema.ResourceData, m interface{})
return err
}

d.Set("content_type", res.GetPayload().ContentType)
ct := res.GetPayload().ContentType
if ct == "" {
ct = res.GetPayload().ObjectType
}
d.Set("content_type", ct)

if res.GetPayload().ObjectID != nil {
d.Set("object_id", res.GetPayload().ObjectID)
Expand Down

0 comments on commit 0f1b004

Please sign in to comment.