Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#13473 closed enhancement (fixed)

Allow regex to allow empty fields

Reported by: jsnell@… Owned by: jsnell@…
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):

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 6 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

comment:3 Changed 6 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17288:

TracTicketValidator 0.5: Allow empty or match

Patch by jsnell@…

Fixes #13473.

comment:4 Changed 6 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to jsnell@…

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jsnell@….
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.