mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Moved user email nulling until after the save
This commit is contained in:
parent
0291323502
commit
134e8e6fb9
|
@ -72,14 +72,15 @@ class CheckinLicensesFromAllUsers extends Command
|
||||||
|
|
||||||
foreach ($licenseSeats as $seat) {
|
foreach ($licenseSeats as $seat) {
|
||||||
$this->info($seat->user->username .' has a license seat for '.$license->name);
|
$this->info($seat->user->username .' has a license seat for '.$license->name);
|
||||||
|
|
||||||
if (!$notify) {
|
|
||||||
$seat->user->email = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$seat->assigned_to = null;
|
$seat->assigned_to = null;
|
||||||
|
|
||||||
if ($seat->save()) {
|
if ($seat->save()) {
|
||||||
|
|
||||||
|
// Override the email address so we don't notify on checkin
|
||||||
|
if (!$notify) {
|
||||||
|
$seat->user->email = null;
|
||||||
|
}
|
||||||
|
|
||||||
// Log the checkin
|
// Log the checkin
|
||||||
$seat->logCheckin($seat->user, 'Checked in via cli tool');
|
$seat->logCheckin($seat->user, 'Checked in via cli tool');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue