Opened 6 years ago
Last modified 6 years ago
#13473 closed enhancement
Allow regex to allow empty fields — at Version 1
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | TracTicketValidatorPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description (last modified by )
This diff will allow the regex to allow for an empty field or a match.
Then, if a value is always required a rule with .+
instead of .*
could be used instead.
-
ticketvalidator.py
82 82 fieldValue = req.args.get(field) 83 83 84 84 if fieldValue is not None: 85 if not fieldValue or(rule and re.match(rule, fieldValue) is None):85 if (rule and re.match(rule, fieldValue) is None): 86 86 return errorMessage 87 87 88 88 def _isValidateEmail(self, email):
Note: See
TracTickets for help on using
tickets.