Project

General

Profile

Bug #40780

Fix bug that prevented updating a user using APIv1

Added by Dominik Bauer over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I try to update an user via the API endpoint "/api/v1.0/account/users/". I have tried different variations, but always get the same error.

API Call:

curl 'http://10.3.2.2/api/v1.0/account/users/78/' -H 'Authorization: Basic .......' -H "Content-Type: application/json" -X PUT --data '{"bsdusr_full_name":"asdf"}'

Return:

  File "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 219, in wrapper
    response = callback(request, *args, **kwargs)

  File "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 459, in dispatch_detail
    return self.dispatch('detail', request, **kwargs)

  File "./freenasUI/api/utils.py", line 251, in dispatch
    request_type, request, *args, **kwargs

  File "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 482, in dispatch
    response = method(request, **kwargs)

  File "./freenasUI/api/utils.py", line 332, in put_detail
    updated_bundle = self.obj_update(bundle=bundle, **self.remove_api_resource_names(kwargs))

  File "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 2236, in obj_update
    return self.save(bundle, skip_errors=skip_errors)

  File "./freenasUI/api/utils.py", line 415, in save
    form.save()

  File "./freenasUI/account/forms.py", line 401, in save
    pk = c.call(*args, data)

  File "./freenasUI/account/forms.py", line 401, in save
    pk = c.call(*args, data)

  File "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py", line 437, in call
    raise ClientException(c.error, c.errno, c.trace, c.extra)

middlewared.client.client.ClientException: invalid literal for int() with base 8: ''

I have tested it with FreeNAS 11.1 and FreeNAS 11.2-BETA2.

Associated revisions

Revision d3101231 (diff)
Added by Waqar Ahmed over 1 year ago

Bug fix for api v1 This commit fixes a bug where a user resource couldn't be updated if the home_mode attr was not specified in the payload. Ticket: #40780

History

#1 Updated by Dru Lavigne over 1 year ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski over 1 year ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from Backlog to 11.2-BETA3

Waqar, can you investigate this, please?

#3 Updated by Waqar Ahmed over 1 year ago

  • Status changed from Unscreened to In Progress

#4 Updated by Dru Lavigne over 1 year ago

#5 Updated by Waqar Ahmed over 1 year ago

  • Status changed from In Progress to Ready for Testing

#6 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Can't update user over API to Fix bug that prevented updating a user using APIv1
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#7 Updated by Michael Reynolds over 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

I was able to update a test user's full name using apiv1.0 calls

#8 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF