Skip to content

Commit

Permalink
fix: unsupported relations: Roles
Browse files Browse the repository at this point in the history
Error when doing  `user update --unassign-group <my_group> <my_user>`
  • Loading branch information
libvoid committed Apr 24, 2024
1 parent 3b3e630 commit 9b3b537
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/bastion/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ GLOBAL OPTIONS:
var hop string
if host.HopID != 0 {
var hopHost dbmodels.Host
if err := db.Model(host).Association("HopID").Find(&hopHost); err != nil {
if err := db.Model(host).Association("Hop").Find(&hopHost); err != nil {
return err
}
hop = hopHost.Name
Expand Down Expand Up @@ -1037,7 +1037,7 @@ GLOBAL OPTIONS:
if c.Bool("unset-hop") {
var hopHost dbmodels.Host

if err := db.Model(&host).Association("HopID").Find(&hopHost); err != nil {
if err := db.Model(&host).Association("Hop").Find(&hopHost); err != nil {
return err
}
if err := model.Association("Hop").Clear(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/bastion/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func ChannelHandler(srv *ssh.Server, conn *gossh.ServerConn, newChan gossh.NewCh
}}, sessionConfigs...)
if currentHost.HopID != 0 {
var newHost dbmodels.Host
if err := actx.db.Model(currentHost).Association("HopID").Find(&newHost); err != nil {
if err := actx.db.Model(currentHost).Association("Hop").Find(&newHost); err != nil {
log.Printf("Error: %v", err)
return
}
Expand Down

0 comments on commit 9b3b537

Please sign in to comment.