mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-13 20:44:43 +08:00
changed not and else
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user