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

Trying to save bytes in StringField #2

Open
PokeTheCiTy opened this issue Aug 4, 2017 · 0 comments
Open

Trying to save bytes in StringField #2

PokeTheCiTy opened this issue Aug 4, 2017 · 0 comments

Comments

@PokeTheCiTy
Copy link

Hi,

in Class MongoengineAssociationMixin, secret is a StringField but you call base64.encodestring(association.secret) to store it.

This method expects and returns bytes so the ending .save() does not pass validation.

To fix it, there are 2 solutions:

  • base64.encodestring(association.secret).decode() and store it like a string
  • change secret as a BinaryField instead of StringField

Have a nice day :)

Disclaimer:
Even if I've read guidelines, I'm new in "issue reporting" so tell me if you need any further informations

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

No branches or pull requests

1 participant