mirror of
https://git.wownero.com/lza_menace/wowstash.git
synced 2024-08-15 00:33:15 +00:00
add another check on seed inputs
This commit is contained in:
parent
f2677349dc
commit
d0b573a11c
1 changed files with 4 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
from re import match as re_match
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, BooleanField
|
||||
from wtforms.validators import DataRequired, ValidationError
|
||||
|
@ -26,5 +27,8 @@ class Restore(FlaskForm):
|
|||
risks_accepted = BooleanField('I accept the risks:', validators=[DataRequired()], render_kw={"class": "form-control-span"})
|
||||
|
||||
def validate_seed(self, seed):
|
||||
regex = '^[\w\s]+$'
|
||||
if bool(re_match(regex, self.seed.data)) is False:
|
||||
raise ValidationError('Invalid seed provided; must be alphanumeric characters only')
|
||||
if len(self.seed.data.split()) != 25:
|
||||
raise ValidationError("Invalid seed provided; must be standard Wownero 25 word format")
|
||||
|
|
Loading…
Reference in a new issue