Skip to content

Commit

Permalink
Moved user email nulling until after the save
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Aug 14, 2020
1 parent 0291323 commit 134e8e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/Console/Commands/CheckinLicensesFromAllUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 134e8e6

Please sign in to comment.