mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 09:26:00 +03:00
[GH-ISSUE #884] KeyError exception when altering user via API #782
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#782
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jficz on GitHub (Jun 2, 2016).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/884
When I try to alter an account via API using API key of a SuperAdmin user (the id=1 user in fact), I get this error:
With this stack trace:
Debian Jessie latest, barebone. Modoba installed in a virutalenv using pip install method.
Curl command used to make the api call:
curl -ik -X POST -H "Authorization: Token XXX" -d username=root -d language=cs https://<my_domain>api/v1/accounts/2/Response header:
HTTP/1.1 500 Internal Server Error Server: nginx/1.10.1 Date: Thu, 02 Jun 2016 21:01:30 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Language: enI'll be more than happy to provide any additional information as needed.
@tonioo commented on GitHub (Jun 6, 2016):
@cptMikky Thanks for the feedback.
I realize I did not implement the PATCH method properly. It is provided by default (django rest framework) and I should have disabled it.
@jficz commented on GitHub (Jun 6, 2016):
How does one alter an existing account via API then? Or am I missing something?
@tonioo commented on GitHub (Jun 7, 2016):
You can use the PUT method.