valq7711 / ombott

This is bottle spin-off (One More BOTTle)
MIT License
8 stars 5 forks source link

Non ascii characters are not sent to db #7

Closed jparga closed 2 years ago

jparga commented 2 years ago

Non ascii characters are stored in db through py4web form,

Changing recode_unicode=False in line 143 of request/helpers.py seems to solve the problem https://github.com/valq7711/ombott/blob/f18f6e0e639f20efb63b137edbab8c8b3871d354/ombott/request/helpers.py#L143

valq7711 commented 2 years ago

Ascii characters entered in the form become non-ascii? Could you povide more details, please?

jparga commented 2 years ago

No, non ascii characters cause an error and the value is not stored in the db. If the record is edited from an existing one then the value of the fields with no ascii characters is set to None. If there is a IS_NOT_EMPTY() validator then the error 'Enter a value' rises. This is the explanation of the error. https://groups.google.com/g/py4web/c/s5W-8zgvmoA/m/Fn3mRYwrCQAJ

This is the patched solution: https://discord.com/channels/836984759535534120/836984759535534125/1006343351190171718

valq7711 commented 2 years ago

OK, will fix https://github.com/bottlepy/bottle/pull/1068

valq7711 commented 2 years ago

fixed https://github.com/valq7711/ombott/commit/fcb2abe53e8572144d7b1fcaf06e5dbb73955ff2 v0.1.0 on pypi