🐛(backend) enforce emoji validation for reactions#1965
🐛(backend) enforce emoji validation for reactions#1965maboukerfa wants to merge 1 commit intosuitenumerique:mainfrom
Conversation
d709426 to
f2b1da9
Compare
lunika
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution.
Just one comment, and it will be good.
|
|
||
| def validate_emoji(self, value): | ||
| """Ensure the reaction is a single emoji.""" | ||
| if not emoji.is_emoji(value): |
There was a problem hiding this comment.
Can you please add a warning log here? To ensure that valid emoji are not rejected?
Validate emojis in ReactionSerializer (previously accepted any string), preventing multiple emojis or text uploads in a single reaction Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
f2b1da9 to
ca38eaa
Compare
|
Hey @lunika, any updates on this? |
Thank you for your patience. About emoji, we would like to localize them. Will your validation still work once it's made? Thanks. |
|
Alright, thanks for the update! Yes, the validation should still work as long as the localization is handled on the front end. On the backend, I’m using the Unicode encoding for emojis, so it remains consistent regardless of how they’re implemented in the front. I'll check it again once the localization implemented |
Purpose
This pull request enforces emoji validation in the
ReactionSerializerto prevent invalid emoji submissions.Proposal
ReactionSerializer(previously accepted any string)