Opened 6 years ago

Last modified 6 years ago

#13473 closed enhancement

Allow regex to allow empty fields — at Version 1

Reported by: jsnell@… Owned by:
Priority: normal Component: TracTicketValidatorPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description (last modified by Ryan J Ollos)

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

     
    8282            fieldValue = req.args.get(field)
    8383
    8484        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):
    8686                return errorMessage
    8787
    8888    def _isValidateEmail(self, email):

Change History (1)

comment:1 Changed 6 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.