Permissions: has_permission() takes 3 positional arguments but 4 were given
See original GitHub issueI am getting this error after I updated the package
2017-06-01 02:16:22,002 - ERROR - worker - Error processing message with consumer faceoff_api.routing.APIDemultiplexer:
Traceback (most recent call last):
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/worker.py", line 119, in run
consumer(message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/generic/base.py", line 32, in __init__
self.dispatch(message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/generic/base.py", line 70, in dispatch
return self.get_handler(message, **kwargs)(message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/generic/websockets.py", line 154, in raw_receive
self.receive(self.decode_json(message['text']), **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/generic/websockets.py", line 266, in receive
consumer(self.message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/binding/base.py", line 240, in consumer
handler(message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/sessions.py", line 78, in inner
return func(*args, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/auth.py", line 42, in inner
return func(message, *args, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/binding/websockets.py", line 90, in trigger_inbound
super(WebsocketBinding, cls).trigger_inbound(message, **kwargs)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels/binding/base.py", line 222, in trigger_inbound
self.run_action(self.action, self.pk, self.data)
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels_api/bindings.py", line 145, in run_action
if not self.has_permission(self.user, action, pk):
File "/Users/coreytrombley/.envs/faceoff_venv/lib/python3.5/site-packages/channels_api/bindings.py", line 111, in has_permission
if not cls().has_permission(user, action, pk):
TypeError: has_permission() takes 3 positional arguments but 4 were given
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to resolve error "object_permission() takes 3 positional ...
When I run my code, I get an error message saying that I am using too many positional arguments. TypeError: has_object_permission() takes 3...
Read more >How to resolve error "object_permission() takes 3 positional ...
Coding example for the question How to resolve error "object_permission() takes 3 positional arguments but 4 were given"?-django.
Read more >has_add_permission() takes 2 positional arguments but 3 ...
Support for `InlineModelAdmin.has_add_permission()` methods that don't accept `obj` as the second positional argument was deprecated in Django
Read more >has_add_permission() takes 2 positional arguments but 3 ...
has_add_permission() takes 2 positional arguments but 3 were given. ... obj=None): inline_instances = [] for inline_class in self.get_inlines(request, ...
Read more >takes 3 positional arguments but 4 were given | SmartAPI Forum
Hi @piidus ,. Please use the following command to upgrade to the latest python release pip install smartapi-python --upgrade.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To filter the create messages you will need to put the users in a group that is scoped to their user instead of the resource. This can be accomplished by implementing the method
_group_name(self, action, id=None)
on your binding class to return a string unique to that resource and user. Here’s a rough ideaHi there, what version of channels are you using? Can you share a form of your binding class? Thanks