server/tags: fix tag category color validation
This was totally stupid...
This commit is contained in:
parent
a5b2d835d6
commit
4cd5b8c1ac
|
@ -51,7 +51,7 @@ def update_category_name(category, name):
|
||||||
def update_category_color(category, color):
|
def update_category_color(category, color):
|
||||||
if not color:
|
if not color:
|
||||||
raise InvalidTagCategoryNameError('Color cannot be empty.')
|
raise InvalidTagCategoryNameError('Color cannot be empty.')
|
||||||
if not re.match(r'^#?[a-z]+$', color):
|
if not re.match(r'^#?[0-9a-z]+$', color):
|
||||||
raise InvalidTagCategoryNameError('Invalid color.')
|
raise InvalidTagCategoryNameError('Invalid color.')
|
||||||
if util.value_exceeds_column_size(color, db.TagCategory.color):
|
if util.value_exceeds_column_size(color, db.TagCategory.color):
|
||||||
raise InvalidTagCategoryColorError('Color is too long.')
|
raise InvalidTagCategoryColorError('Color is too long.')
|
||||||
|
|
Loading…
Reference in New Issue