mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-02 18:04:23 +08:00
changed not and else
This commit is contained in:
parent
e8db6e247f
commit
fa2d8ef8ee
1 changed files with 3 additions and 2 deletions
|
@ -81,7 +81,7 @@ func grpcAuthorize(ctx context.Context) error {
|
|||
}
|
||||
emptynode := models.Node{}
|
||||
node, err := functions.GetNodeByMacAddress(network, mac)
|
||||
if !database.IsEmptyRecord(err) {
|
||||
if database.IsEmptyRecord(err) {
|
||||
if node, err = functions.GetDeletedNodeByMacAddress(network, mac); err != nil {
|
||||
if !database.IsEmptyRecord(err) {
|
||||
if functions.RemoveDeletedNode(node.ID) {
|
||||
|
@ -90,7 +90,8 @@ func grpcAuthorize(ctx context.Context) error {
|
|||
}
|
||||
return status.Errorf(codes.Unauthenticated, "Node does not exist.")
|
||||
}
|
||||
} else if err != nil || node.MacAddress == emptynode.MacAddress {
|
||||
}
|
||||
if err != nil || node.MacAddress == emptynode.MacAddress {
|
||||
return status.Errorf(codes.Unauthenticated, "Node does not exist.")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue