Fixes bug preventing proper updating of caches and models due to undefined Auth::user()
This commit is contained in:
parent
e688468920
commit
5d59d364f8
2 changed files with 5 additions and 2 deletions
|
@ -11,6 +11,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fixes potential bug with invalid CIDR notation (ex: `192.168.1.1/z`) when adding allocations that could cause over 4 million records to be created at once.
|
* Fixes potential bug with invalid CIDR notation (ex: `192.168.1.1/z`) when adding allocations that could cause over 4 million records to be created at once.
|
||||||
|
* `[pre.4]` — Fixes bug preventing server updates from occurring by the system due to undefined `Auth::user()` in the event listener.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
* Ability to assign multiple allocations at once when creating a new server.
|
* Ability to assign multiple allocations at once when creating a new server.
|
||||||
|
|
|
@ -142,8 +142,10 @@ class ServerObserver
|
||||||
public function updated(Server $server)
|
public function updated(Server $server)
|
||||||
{
|
{
|
||||||
// Clear Caches
|
// Clear Caches
|
||||||
|
if (Auth::user()) {
|
||||||
Cache::forget('Server.byUuid.' . $server->uuid . Auth::user()->uuid);
|
Cache::forget('Server.byUuid.' . $server->uuid . Auth::user()->uuid);
|
||||||
Cache::forget('Server.byUuid.' . $server->uuidShort . Auth::user()->uuid);
|
Cache::forget('Server.byUuid.' . $server->uuidShort . Auth::user()->uuid);
|
||||||
|
}
|
||||||
|
|
||||||
event(new Events\Server\Updated($server));
|
event(new Events\Server\Updated($server));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue