-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Validation error for colour selected via picker #61
Comments
@philclaridge this is really strange. I could understand if your only case would be reading a previously stored color without the I'm not able to reproduce the issue you reported. In all my tests color is always prefixed correctly by |
@philclaridge any feedback? |
Feel free to re-open this issue if you have an useful feedback to provide. |
I believe this is an underlying issue with JSColor when a Content Security Policy doesn't allow |
Thank you for the useful information. |
Python version
3.8
Django version
3.0.7
Package version
0.3.2 (including jscolor 2.1.1)
Browser
Safari and Chrome
Current behavior (bug description)
Validation error on admin screen "Enter a valid color."
Occurs for colour edited via picker, or default colour or colour with # previously read from database.
On deeper inspection colours selected with colour picker are displayed without a leading hash symbol. Value without leading hash then fails validation at line 16 of fields.py. (have added additional validator to intercept and confirm value to be validated has no leading hash).
When reading colour from database (that had a leading hash) the colour is now displayed without the leading hash and validation fails on save even if colour not changed.
Have run collect static to verify have latest JS.
Have recently upgraded number of other library including upgrade to Django 3.0.7
See image below.
Expected behaviour
Unchanged colour and picked colour will not cause validation error.
Leading hash preserved on entered/default colour.
The text was updated successfully, but these errors were encountered: