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

Posible bug in parse_params #7

Closed
josejachuf opened this issue Jan 18, 2021 · 4 comments
Closed

Posible bug in parse_params #7

josejachuf opened this issue Jan 18, 2021 · 4 comments
Labels
question Further information is requested

Comments

@josejachuf
Copy link
Contributor

josejachuf commented Jan 18, 2021

Hi @gi0baro
it seems to me that there is a bug in parse_params. Maybe I am doing something wrong, but with the following it does not work

@users.update()
async def user_edit(dbset, rid):
    attrs = await users.parse_params()
    body_params = await request.body_params

    print(attrs, body_params)

attrs is always empty. I put the also the request.body_params to check

The output of the print is:

<sdict {}> <sdict {'id': 3, 'registration_key': 'blocked'}>

Best regards
Jose

@gi0baro
Copy link
Member

gi0baro commented Jan 18, 2021

@josejachuf did you defined a parser class or you just relying onto model itself?

@josejachuf
Copy link
Contributor Author

@gi0baro its on the same model

@gi0baro
Copy link
Member

gi0baro commented Jan 18, 2021

@josejachuf if I understood your code the model is from the Emmett's auth module.
The default model has disabled read-write permissions for the registration_key field, so you can add to your user model the relevant configuration as stated by doc:

rest_rw = {
    'registration_key': True
}

@josejachuf
Copy link
Contributor Author

It was that. Thank you so much

@gi0baro gi0baro added the question Further information is requested label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants