server/tag-categories: disallow uppercase colors
This commit is contained in:
parent
c9cb9aa539
commit
1fe22a4d0a
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ def update_category_color(category: model.TagCategory, color: str) -> None:
|
||||||
assert category
|
assert category
|
||||||
if not color:
|
if not color:
|
||||||
raise InvalidTagCategoryColorError('Color cannot be empty.')
|
raise InvalidTagCategoryColorError('Color cannot be empty.')
|
||||||
if not re.match(r'^#?[0-9A-Za-z]+$', color):
|
if not re.match(r'^#?[0-9a-z]+$', color):
|
||||||
raise InvalidTagCategoryColorError('Invalid color.')
|
raise InvalidTagCategoryColorError('Invalid color.')
|
||||||
if util.value_exceeds_column_size(color, model.TagCategory.color):
|
if util.value_exceeds_column_size(color, model.TagCategory.color):
|
||||||
raise InvalidTagCategoryColorError('Color is too long.')
|
raise InvalidTagCategoryColorError('Color is too long.')
|
||||||
|
|
Loading…
Reference in a new issue