Explorar o código

Update FixUsernames command, skip admin and deleted users

Daniel Supernault %!s(int64=5) %!d(string=hai) anos
pai
achega
6583957dc8
Modificáronse 1 ficheiros con 3 adicións e 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);
                 }