addons-server
addons-server copied to clipboard
Handle Non-Alphanumerical Edge Cases When Searching Themes By Colour
Fixes: mozilla/addons#15022
Description
Moved all formatting to its own function (convert_to_hex) that either returns a valid 6-character hex string or raises a ValueError.
Context
Testing
Checklist
- [ ] Add
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository. - [ ] Successfully verified the change locally.
- [ ] The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
- [ ] Add before and after screenshots (Only for changes that impact the UI).
- [ ] Add or update relevant docs reflecting the changes made.
🔍 Existing Issues For Review
Your pull request is modifying functions with the following pre-existing issues:
📄 File: src/olympia/search/filters.py
| Function | Unhandled Issue |
|---|---|
get_es_query |
TypeError: hsl() takes 3 positional arguments but 4 were given /api/v5/... Event Count: 5 |
get_es_query |
TypeError: hsl() missing 3 required positional arguments: 'r', 'g', and 'b' /... Event Count: 1 |
get_es_query |
TypeError: hsl() missing 1 required positional argument: 'b' /api/v5/ad... Event Count: 1 |
Did you find this useful? React with a 👍 or 👎