plone / plone/plone.restapi

"type": "MissingParameterError" for existing users (POST to @users)

Open
#500 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 type: bug
Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Description

Trying to create a new user (POST to @users) creates the following error (which is ok) if a user already exists. However "type": "MissingParameterError" is misleading and makes no sense here.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "migration/migrate.py", line 360, in <module>
    migrate_users()
  File "migration/migrate.py", line 351, in migrate_users
    add_user(old2new_path('dynamore'), d.id, pw, fullname, email, roles)
  File "migration/migrate.py", line 172, in add_user
    raise RuntimeError(result.text)
RuntimeError: {
  "error": {
    "message": "The login name you selected is already in use or is not valid. Please choose another.",
    "type": "MissingParameterError"
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the POST to @users described in migration/migrate.py, especially the add_user call reported at line 172, and reproduce the existing-user response. Trace where that response's error type is assigned; done means the response keeps the existing-user message while reporting an error type that accurately describes the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.