Skip to content

Commit ae843a7

Browse files
committed
This took an ungodly long amount of time to debug as the cause of issues frontend.
1 parent 32b6bfb commit ae843a7

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

app/Models/Server.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public static function getUserServers($paginate = null)
121121
}
122122

123123
/**
124-
* Returns a single server specified by UUID
124+
* Returns a single server specified by UUID.
125+
* DO NOT USE THIS TO MODIFY SERVER DETAILS OR SAVE THOSE DETAILS.
126+
* YOU WILL OVERWRITE THE SECRET KEY AND BREAK THINGS.
125127
*
126128
* @param string $uuid The Short-UUID of the server to return an object about.
127129
* @return \Illuminate\Database\Eloquent\Collection
@@ -147,17 +149,6 @@ public static function getByUUID($uuid)
147149
$result->daemonSecret = self::getUserDaemonSecret($result);
148150
}
149151

150-
// Prevent saving of model called in this manner.
151-
// Prevents accidental overwrite of main daemon secret.
152-
$result::saving(function () {
153-
return false;
154-
});
155-
156-
// Prevent deleting this model call.
157-
$result::deleting(function () {
158-
return false;
159-
});
160-
161152
self::$serverUUIDInstance[$uuid] = $result;
162153
return self::$serverUUIDInstance[$uuid];
163154

0 commit comments

Comments
 (0)