#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)
Change History (11)
Changed 7 years ago by
Attachment: | Accreditation.py.patch added |
---|
Changed 7 years ago by
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
Looks good. You could use to_list
from trac.util
to simplify it slightly.
comment:4 Changed 7 years ago by
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
Attachment: | t13258.diff added |
---|
comment:5 Changed 7 years ago by
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
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
Got it.
I learnt to use the trac.db.schema
in new plugins. Gonna modify this later.
patch that includes update to strip spaces surrounding the commas within the entered participants list