From 1ef3c1b1546c22de7b62c0df85c56a58cdbe7c91 Mon Sep 17 00:00:00 2001 From: xemeds Date: Fri, 21 Aug 2020 18:05:30 +0300 Subject: [PATCH] Tokens that are the same as a pages route are no longer allowed --- tiny0/forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tiny0/forms.py b/tiny0/forms.py index 1a07e98..c546bea 100644 --- a/tiny0/forms.py +++ b/tiny0/forms.py @@ -47,6 +47,11 @@ def validate_token(form, field): if len(field.data) < 6 or len(field.data) > 16: return + # If the token is the same as a pages route + if field.data == "donate" or field.data == "tracker" or field.data == "lookup": + # Raise a ValidationError + raise ValidationError("Token already exists") + # For each character in the token for char in field.data: # If it is not a valid character