From 134e8e6fb9958e71b8fa960de53c041324bd9e1c Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 14 Aug 2020 15:25:07 -0700 Subject: [PATCH] Moved user email nulling until after the save --- app/Console/Commands/CheckinLicensesFromAllUsers.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/CheckinLicensesFromAllUsers.php b/app/Console/Commands/CheckinLicensesFromAllUsers.php index a4e74778172c..bcd8583eafa4 100644 --- a/app/Console/Commands/CheckinLicensesFromAllUsers.php +++ b/app/Console/Commands/CheckinLicensesFromAllUsers.php @@ -72,14 +72,15 @@ public function handle() foreach ($licenseSeats as $seat) { $this->info($seat->user->username .' has a license seat for '.$license->name); - - if (!$notify) { - $seat->user->email = null; - } - $seat->assigned_to = null; if ($seat->save()) { + + // Override the email address so we don't notify on checkin + if (!$notify) { + $seat->user->email = null; + } + // Log the checkin $seat->logCheckin($seat->user, 'Checked in via cli tool'); }