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

controller.context.kwargs is empty in 0.22.0 #227

Open
asemoon opened this issue Jan 10, 2025 · 3 comments
Open

controller.context.kwargs is empty in 0.22.0 #227

asemoon opened this issue Jan 10, 2025 · 3 comments

Comments

@asemoon
Copy link

asemoon commented Jan 10, 2025

controller.context.kwargs.get('data') used to give me the data already passed to the controller serialized. so I can just access it here but after 0.22.0 this value is returning as None.
Is this a bug or an intended change?

I understand I can get the data from the request.body but that means it needs to be re-processed from json which seem redundant.

class IsUserAllowedToUpdate(BasePermission):
    def has_permission(self, request: HttpRequest, controller) -> bool:
        data = controller.context.kwargs.get('data')
        mydata= data.mydata
        
@eadwinCode
Copy link
Owner

eadwinCode commented Jan 10, 2025

@asemoon Can I see your route setup? It's supposed to be present in the context.kwargs.get('data')

@eadwinCode
Copy link
Owner

@asemoon I see what is happening now, an update was made to check for permissions before schema validation. That's the only way this can be happening.
I will look to see if there is a workaround.

@asemoon
Copy link
Author

asemoon commented Jan 10, 2025

@eadwinCode appreciate your quick response man. looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants