Update sharing.go

Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
This commit is contained in:
Juan Font 2021-09-10 00:32:42 +02:00 committed by GitHub
parent b098d84557
commit 4b4a5a4b93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ func (h *Headscale) AddSharedMachineToNamespace(m *Machine, ns *Namespace) error
return errorSameNamespace return errorSameNamespace
} }
sn := SharedMachine{} sharedMachine := SharedMachine{}
if err := h.db.Where("machine_id = ? AND namespace_id", m.ID, ns.ID).First(&sharedMachine).Error; err == nil { if err := h.db.Where("machine_id = ? AND namespace_id", m.ID, ns.ID).First(&sharedMachine).Error; err == nil {
return errorMachineAlreadyShared return errorMachineAlreadyShared
} }