maintenance: Replace deprecated User::idFromName

Bug: T325687
Change-Id: I01c0a4ec1076ff360cd93cef86e0b40967e61f46
This commit is contained in:
Umherirrender 2022-12-21 20:12:14 +01:00
parent bb95e89c23
commit d56f7e5dbc

View file

@ -94,8 +94,8 @@ class CreateBotPassword extends Maintenance {
$passwordFactory = $services->getPasswordFactory();
$userId = User::idFromName( $username );
if ( $userId === null ) {
$userIdentity = $services->getUserIdentityLookup()->getUserIdentityByName( $username );
if ( !$userIdentity || !$userIdentity->isRegistered() ) {
$this->fatalError( "Cannot create bot password for non-existent user '$username'." );
}