Commit 8e536c67 authored by Robin McCorkell's avatar Robin McCorkell
Browse files

Merge pull request #15050 from owncloud/user-create-exists

show a better error message when trying to create a user that already exists
parents b6676c32 da4ad1c0
......@@ -286,6 +286,15 @@ class UsersController extends Controller {
if ($this->userManager->userExists($username)) {
return new DataResponse(
'message' => (string)$this->l10n->t('A user with that name already exists.')
try {
$user = $this->userManager->createUser($username, $password);
} catch (\Exception $exception) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment