Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix/release 2023.42-patch 1 : Update V3 Module ServiceProvider & A…
Browse files Browse the repository at this point in the history
…pp UserCreateCommand.php (#4668)

* Update V3 Module ServiceProvider.php

* Update UserCreateCommand.php

* Webong patch 2 (#4667)

* Update V3 Module ServiceProvider.php

* Update UserCreateCommand.php

* Update ServiceProvider.php

Replace TagRepository with TosRepository

* Update ServiceProvider.php
webong authored and Mh-Asmi committed Nov 20, 2023
1 parent 9c1f980 commit 3e1de9a
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/UserCreateCommand.php
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ public function handle(UserRepository $userRepo, TosRepository $tosRepo)
'email' => 'required|email|unique:users',
'password' => 'required|min:7|max:72',
'realname' => 'max:150',
'role' => ['exists:roles', function ($attribute, $value, $fail) use ($userRepo) {
'role' => ['exists:roles,name', function ($attribute, $value, $fail) use ($userRepo) {
$limit = Feature::getLimit('admin_users');
if ($limit !== INF && $value == 'admin') {
$total = $userRepo->getTotalCount(['role' => 'admin']);
@@ -75,8 +75,8 @@ public function handle(UserRepository $userRepo, TosRepository $tosRepo)
}]
]);

if (!$validator->failed()) {
throw new ValidatorException('Failed to validate user', $validator->errors());
if ($validator->failed()) {
throw new ValidatorException('Failed to validate user', $validator->errors()->toArray());
}

$entity = $userRepo->getEntity();
14 changes: 7 additions & 7 deletions src/Ushahidi/Modules/V3/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -2,27 +2,27 @@

namespace Ushahidi\Modules\V3;

use Ushahidi\Core\Tool\Verifier;
use Ushahidi\Modules\V3\Console;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Ushahidi\Modules\V3\Console;
use Ushahidi\Modules\V3\Factory\UsecaseFactory;
use Ushahidi\Modules\V3\Http\Middleware\RepositoryBinder;
use Ushahidi\Core\Tool\Verifier;
use Ushahidi\Core\Usecase\User\LoginUser;
use Ushahidi\Core\Usecase\Post\ExportPost;
use Ushahidi\Core\Usecase\Export\Job\PostCount;
use Ushahidi\Modules\V3\Factory\UsecaseFactory;
use Ushahidi\Core\Usecase\Message\ReceiveMessage;
use Ushahidi\Modules\V3\Repository\TosRepository;
use Ushahidi\Core\Usecase\Export\Job\PostCount;
use Ushahidi\Contracts\Repository\Entity\TosRepository;
use Ushahidi\Contracts\Repository\Entity\SetRepository;
use Ushahidi\Contracts\Repository\Entity\PostRepository;
use Ushahidi\Contracts\Repository\Entity\RoleRepository;
use Ushahidi\Contracts\Repository\Entity\UserRepository;
use Ushahidi\Contracts\Repository\Entity\MediaRepository;
use Ushahidi\Modules\V3\Http\Middleware\RepositoryBinder;
use Ushahidi\Contracts\Repository\Entity\ApiKeyRepository;
use Ushahidi\Contracts\Repository\Entity\ConfigRepository;
use Ushahidi\Contracts\Repository\Entity\ContactRepository;
use Ushahidi\Contracts\Repository\Entity\MessageRepository;
use Ushahidi\Contracts\Repository\Entity\ExportJobRepository;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Ushahidi\Contracts\Repository\Entity\ExportBatchRepository;
use Ushahidi\Contracts\Repository\Entity\FormAttributeRepository;
use Ushahidi\Contracts\Repository\Entity\TargetedSurveyStateRepository;

0 comments on commit 3e1de9a

Please sign in to comment.