Skip to content

Trying to save bytes in StringField #2

@PokeTheCiTy

Description

@PokeTheCiTy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions