From 6583957dc8c52f7f13f3ee5e413d2cb72ff3e56b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 13 Nov 2019 23:30:02 -0700 Subject: [PATCH] Update FixUsernames command, skip admin and deleted users --- app/Console/Commands/FixUsernames.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Console/Commands/FixUsernames.php b/app/Console/Commands/FixUsernames.php index a9333828..5ba49a6a 100644 --- a/app/Console/Commands/FixUsernames.php +++ b/app/Console/Commands/FixUsernames.php @@ -48,6 +48,9 @@ class FixUsernames extends Command $users = User::chunk(100, function($users) use($affected, $restricted) { foreach($users as $user) { + if($user->is_admin || $user->status == 'deleted') { + continue; + } if(in_array($user->username, $restricted)) { $affected->push($user); }