Skip to content

Commit 644c07e

Browse files
committed
Fix broken port deletion
1 parent efdc3e6 commit 644c07e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
66
## v0.6.0-pre.4 (Courageous Carniadactylus)
77
### Fixed
88
* `[pre.3]` — Fixes bug in cache handler that doesn't cache against the user making the request. Would have allowed for users to access servers not belonging to themselves in production.
9+
* `[pre.3]` — Fixes misnamed MySQL column that was causing the inability to delete certain port ranges from the database.
910

1011
### Added
1112
* New cache policy for ServerPolicy to avoid making 15+ queries per page load when confirming if a user has permission to perform an action.

app/Http/Controllers/Admin/NodesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function deallocateSingle(Request $request, $node, $allocation)
163163

164164
public function deallocateBlock(Request $request, $node)
165165
{
166-
$query = Models\Allocation::where('node', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
166+
$query = Models\Allocation::where('node_id', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
167167
if ((int) $query === 0) {
168168
Alert::danger('There was an error while attempting to delete allocations on that IP.')->flash();
169169

@@ -199,7 +199,7 @@ public function setAlias(Request $request, $node)
199199

200200
public function getAllocationsJson(Request $request, $id)
201201
{
202-
$allocations = Models\Allocation::select('ip')->where('node', $id)->groupBy('ip')->get();
202+
$allocations = Models\Allocation::select('ip')->where('node_id', $id)->groupBy('ip')->get();
203203

204204
return response()->json($allocations);
205205
}

0 commit comments

Comments
 (0)