浏览代码

Update FixUsernames command, skip admin and deleted users

Daniel Supernault 5 年之前
父节点
当前提交
6583957dc8
共有 1 个文件被更改,包括 3 次插入0 次删除
  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);
                 }