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

Empty text field bodies should be trimmed and set to null if empty #2039

Closed
dessalines opened this issue Jan 16, 2022 · 2 comments
Closed

Empty text field bodies should be trimmed and set to null if empty #2039

dessalines opened this issue Jan 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dessalines
Copy link
Member

Occasionally browsers will set an empty space for text fields, which makes clients show an empty body. The back end should trim all optional text fields and do a replace with null if empty.

@dessalines dessalines added the bug Something isn't working label Jan 16, 2022
@Nutomic
Copy link
Member

Nutomic commented Jan 16, 2022

Could probably be done using deserialize_with, like here: https://github.com/LemmyNet/lemmy/pull/1962/files

@dessalines
Copy link
Member Author

This is happening at the API level, when posts are getting inserted.

Nutomic pushed a commit that referenced this issue Jan 21, 2022
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.

* Revert "Using .map() instead."

This reverts commit a2f4907.
dessalines added a commit that referenced this issue Jan 27, 2022
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.
dessalines added a commit that referenced this issue Jan 27, 2022
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.

* Revert "Using .map() instead."

This reverts commit a2f4907.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants