From 46ea8a40caeb11548e8725825052887f109fa983 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 29 May 2017 18:02:43 +0300 Subject: [PATCH] Fixes... --- app/Jobs/SendNotificationEmail.php | 4 ++++ app/Policies/DocumentPolicy.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Jobs/SendNotificationEmail.php b/app/Jobs/SendNotificationEmail.php index e74ace04d1..2b1213bb1b 100644 --- a/app/Jobs/SendNotificationEmail.php +++ b/app/Jobs/SendNotificationEmail.php @@ -73,6 +73,10 @@ class SendNotificationEmail extends Job implements ShouldQueue */ public function handle(UserMailer $userMailer) { + if (config('queue.default') !== 'sync') { + $this->user->account->loadLocalizationSettings(); + } + $userMailer->sendNotification($this->user, $this->invoice, $this->type, $this->payment, $this->notes); } } diff --git a/app/Policies/DocumentPolicy.php b/app/Policies/DocumentPolicy.php index 1a668c77b2..688728e933 100644 --- a/app/Policies/DocumentPolicy.php +++ b/app/Policies/DocumentPolicy.php @@ -42,6 +42,6 @@ class DocumentPolicy extends EntityPolicy return $user->can('view', $document->invoice); } - return $user->owns($item); + return $user->owns($document); } }