Skip to content

Commit

Permalink
additional characters allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
ialbert committed May 24, 2023
1 parent c1571e2 commit 5607771
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion biostar/forum/forms.py
Expand Up @@ -77,9 +77,15 @@ def valid_tag(text):
raise ValidationError('You have too many tags (5 allowed)')

MAX_ORD = 383

# Additional valid characters
VALID_ORDS = list(range(1, MAX_ORD)) + list(range(8208, 8255))
VALID_ORDS = set(VALID_ORDS)

def validate_ascii(value):

for c in value:
if ord(c) > MAX_ORD:
if ord(c) not in VALID_ORDS:
raise ValidationError(f"Only ASCII characters are allowed. Invalid character {c}, ({ord(c)})")


Expand Down

0 comments on commit 5607771

Please sign in to comment.