Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13258 closed defect (fixed)

Spaces surrounding commas in list of participants are not stripped out

Reported by: anonymous Owned by: Cauly
Priority: normal Component: AccreditationPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

The entered list of participants is currently stripped of leading and trailing spaces, but spaces surrounding each individual comma are not being stripped. I've updated my local version to strip spaces surrounding the commas in the list and I'm going to attach a patch that shows my changes.

NOTE: my changes also update this plug-in to work with Trac 1.0 database API since I am working with Trac 1.1.1.

PS: Slick plug-in. This is exactly what we needed here. It's like you were reading my mind. :-)

Attachments (3)

Accreditation.py.patch (2.4 KB) - added by Richard@… 7 years ago.
patch that includes update to strip spaces surrounding the commas within the entered participants list
Accreditation.py (6.4 KB) - added by Richard@… 7 years ago.
This is the complete file that includes my updates to strip out spaces surrounding commas in the list of participants.
t13258.diff (9.5 KB) - added by Ryan J Ollos 7 years ago.

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by Richard@…

Attachment: Accreditation.py.patch added

patch that includes update to strip spaces surrounding the commas within the entered participants list

Changed 7 years ago by Richard@…

Attachment: Accreditation.py added

This is the complete file that includes my updates to strip out spaces surrounding commas in the list of participants.

comment:1 Changed 7 years ago by Ryan J Ollos

Looks good. You could use to_list from trac.util to simplify it slightly.

comment:2 Changed 7 years ago by Cauly

Resolution: fixed
Status: newclosed

In 16725:

fix #13258

comment:3 Changed 7 years ago by anonymous

Thanks Richard & Ryan

comment:4 Changed 7 years ago by Ryan J Ollos

The code for testing whether the environment needs upgrade will fail for some database types. Also, the plugin is not yet fully compatible with Trac 1.2. I created a patch to tidy some things up, which I will attach.

Changed 7 years ago by Ryan J Ollos

Attachment: t13258.diff added

comment:5 Changed 7 years ago by Cauly

Thanks Ryan, I learnt one more thing about checking the database.

Can you point out which part is not compatible with 1.2? Thank you.

comment:6 Changed 7 years ago by Ryan J Ollos

I misspoke. IEnvironmentSetupParticipant methods should use db=None as arguments for compatibility with Trac 1.0 as well as Trac 1.3.x where the db parameters were removed:

Then, since db parameters can't be used, use self.env.db_transaction as shown in patch.

Also the method of creating the database tables isn't compatible with all databases supported by Trac. The classes in trac.db.schema should be used, and type varchar should be avoided: trac:TracDev/DatabaseSchema.

comment:7 Changed 7 years ago by Cauly

Got it.

I learnt to use the trac.db.schema in new plugins. Gonna modify this later.

comment:8 Changed 7 years ago by Cauly

In 16728:

add support for trac 1.2 or later.
add support for other databases.
(see #13258)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Cauly.
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.