aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-02-26 19:22:28 +0100
committerGravatar Numerlor <[email protected]>2020-02-26 19:22:28 +0100
commit432311ce720a1aea23c3ed7b422615a2e304b070 (patch)
tree293369fcb1040108d491c3ced3d3c5681792a933
parentPass error handler tag fallback through TagNameConverter. (diff)
Remove number check on tags.
This case is already covered by checking if at least one letter is included.
-rw-r--r--bot/converters.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/bot/converters.py b/bot/converters.py
index d73ab73f1..745ce5b5d 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -141,14 +141,6 @@ class TagNameConverter(Converter):
@staticmethod
async def convert(ctx: Context, tag_name: str) -> str:
"""Lowercase & strip whitespace from proposed tag_name & ensure it's valid."""
- def is_number(value: str) -> bool:
- """Check to see if the input string is numeric."""
- try:
- float(value)
- except ValueError:
- return False
- return True
-
tag_name = tag_name.lower().strip()
# The tag name has at least one invalid character.
@@ -163,12 +155,6 @@ class TagNameConverter(Converter):
"Rejecting the request.")
raise BadArgument("Tag names should not be empty, or filled with whitespace.")
- # The tag name is a number of some kind, we don't allow that.
- elif is_number(tag_name):
- log.warning(f"{ctx.author} tried to create a tag with a digit as its name. "
- "Rejecting the request.")
- raise BadArgument("Tag names can't be numbers.")
-
# The tag name is longer than 127 characters.
elif len(tag_name) > 127:
log.warning(f"{ctx.author} tried to request a tag name with over 127 characters. "