Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating collaboration to Owner raises AttributeError #288

Open
4 tasks done
majorgenson opened this issue Aug 26, 2024 · 3 comments
Open
4 tasks done

Updating collaboration to Owner raises AttributeError #288

majorgenson opened this issue Aug 26, 2024 · 3 comments
Assignees
Labels
bug Something isn't working dontstale Mark issues not to be removed by stalebot

Comments

@majorgenson
Copy link

majorgenson commented Aug 26, 2024

Description of the Issue

Updating a Collaboration to the Owner role results in an unhandled AttributeError, despite the collaboration being successfully updated.

Steps to Reproduce

Create or get a Collaboration object and attempt to update the collaboration to the Owner role.

client.user_collaborations.update_collaboration_by_id(
    collaboration.id,
    UpdateCollaborationByIdRole.OWNER.value
)

Expected Behavior

I expected the operation to not raise an unhandled exception.

Error Message, Including Stack Trace

This results in the following traceback:

Traceback (most recent call last):
  File "/home/python/.local/lib/python3.9/site-packages/django/contrib/staticfiles/handlers.py", line 80, in __call__
    return self.application(environ, start_response)
  File "/home/python/.local/lib/python3.9/site-packages/wsgi_middleware/__init__.py", line 36, in __call__
    return self.application(environ, start_response)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/wsgi.py", line 124, in __call__
    response = self.get_response(request)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 140, in get_response
    response = self._middleware_chain(request)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 57, in inner
    response = response_for_exception(request, exc)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 140, in response_for_exception
    response = handle_uncaught_exception(
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 181, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/home/python/.local/lib/python3.9/site-packages/django_extensions/management/technical_response.py", line 40, in null_technical_500_response
    raise exc_value.with_traceback(tb)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/python/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/python/.local/lib/python3.9/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/python/.local/lib/python3.9/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/python/.local/lib/python3.9/site-packages/django/views/generic/edit.py", line 153, in post
    return self.form_valid(form)
  File "/src/files/views.py", line 131, in form_valid
    client.user_collaborations.update_collaboration_by_id(
  File "/home/python/.local/lib/python3.9/site-packages/box_sdk_gen/managers/user_collaborations.py", line 278, in update_collaboration_by_id
    return deserialize(response.data, Collaboration)
  File "/home/python/.local/lib/python3.9/site-packages/box_sdk_gen/serialization/json/serializer.py", line 24, in deserialize
    return type.from_dict(value)
  File "/home/python/.local/lib/python3.9/site-packages/box_sdk_gen/internal/base_object.py", line 18, in from_dict
    for key, value in data.items():
AttributeError: 'NoneType' object has no attribute 'items'

It seems to be because updating a collaboration to Owner returns a 204 response with no content, data is None instead of a Python dict.

Screenshots

N/A

Versions Used

Python SDK: 1.3.0
Python: 3.9.19

@congminh1254
Copy link
Member

Hi @majorgenson

Thanks for your issue, we created a ticket and will address it soon.

Bests,
Minh

@github-staff github-staff deleted a comment from Lxx-c Oct 23, 2024
@github-staff github-staff deleted a comment from Lxx-c Oct 23, 2024
@congminh1254 congminh1254 added the dontstale Mark issues not to be removed by stalebot label Nov 11, 2024
@lukaszsocha2
Copy link
Contributor

Hi,
you issue was fixed by #378. It will be available with the next release. Sorry for the delay.

@majorgenson
Copy link
Author

Great, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dontstale Mark issues not to be removed by stalebot
Projects
None yet
Development

No branches or pull requests

11 participants
@mhagmajer @congminh1254 @lukaszsocha2 @majorgenson @mwwoda @arjankowski @bartlomiejleszczynski and others