mirror of
https://github.com/moul/sshportal.git
synced 2025-09-06 04:35:32 +08:00
unsetting work properly
This commit is contained in:
parent
61b7f72e94
commit
9f0657374b
1 changed files with 2 additions and 1 deletions
3
shell.go
3
shell.go
|
@ -926,8 +926,9 @@ GLOBAL OPTIONS:
|
|||
// remove the hop
|
||||
if c.Bool("unset-hop") {
|
||||
var hopHost Host
|
||||
|
||||
db.Model(&host).Related(&hopHost, "HopID")
|
||||
if err := model.Association("Hop").Delete(hopHost).Error; err != nil {
|
||||
if err := model.Association("Hop").Clear().Error; err != nil {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue