Skip to content

Commit 16222d1

Browse files
committed
redirect if no locations
1 parent 2e88c51 commit 16222d1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1212
### Changed
1313
* Prevent clicking server start button until server is completely off, not just stopping.
1414
* Upon successful creation of a node it will redirect to the allocation tab and display a clearer message to add allocations.
15+
* Trying to add a new node if no location exists redirects user to location management page and alerts them to add a location first.
1516

1617
### Fixed
1718
* Team Fortress named 'Insurgency' in panel in database seeder. ([#96](https://github.com/Pterodactyl/Panel/issues/96), PR by [@MeltedLux](https://github.com/MeltedLux))

app/Http/Controllers/Admin/NodesController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public function getIndex(Request $request)
6565

6666
public function getNew(Request $request)
6767
{
68+
if (!Models\Location::all()->count()) {
69+
Alert::warning('You must add a location before you can add a new node.')->flash();
70+
return redirect()->route('admin.locations');
71+
}
72+
6873
return view('admin.nodes.new', [
6974
'locations' => Models\Location::all()
7075
]);

0 commit comments

Comments
 (0)