From b6e3715cd80a91ae31f82f222791aae2a46cd521 Mon Sep 17 00:00:00 2001 From: Till Deeke Date: Fri, 20 Jul 2018 22:22:49 +0200 Subject: [PATCH] Fix: No Notifications for checking out Consumables (#5898) * Adds a method to consumables to check if a notification should be sent Adds the checkin_email method to Consumables, this gets checked in notifications when checking out the consumable. Without the method, no notifications get sent for checking out consumables. * Fixes the checkin_email method on the License model This should allow the License to also send checkout/checkin notifications again. --- app/Models/Consumable.php | 4 ++++ app/Models/License.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Consumable.php b/app/Models/Consumable.php index 23487c5ba8..7f61c895f1 100644 --- a/app/Models/Consumable.php +++ b/app/Models/Consumable.php @@ -156,6 +156,10 @@ class Consumable extends SnipeModel return $this->belongsToMany('\App\Models\User', 'consumables_users', 'consumable_id', 'assigned_to')->count(); } + public function checkin_email() + { + return $this->category->checkin_email; + } public function requireAcceptance() { diff --git a/app/Models/License.php b/app/Models/License.php index 559b48ebe8..9685b4b8f6 100755 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -228,7 +228,7 @@ class License extends Depreciable public function checkin_email() { - return $this->model->category->checkin_email; + return $this->category->checkin_email; } public function requireAcceptance()