Explorar el Código

Update FixUsernames command, skip admin and deleted users

Daniel Supernault hace 5 años
padre
commit
6583957dc8
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      app/Console/Commands/FixUsernames.php

+ 3 - 0
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);
                 }