Commit 138f4c0a authored by Bartłomiej Żmudziński's avatar Bartłomiej Żmudziński
Browse files

Fix ColorField.

parent d7716cff
......@@ -78,7 +78,8 @@ def parse_color(value):
val = re.findall(r"[-+]?\d*\.\d+|\d+", val)
for idx, el in enumerate(val[:3]):
val[idx] = int(el)
val[3] = float(val[3]) if len(val) > 3 else 1
if len(val) > 3:
val[3] = float(val[3])
return parse_color(val)
raise ValidationError(_('Enter a valid color.'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment