#11371 closed enhancement (fixed)
Fixup whitespace on repository admin pages when saving changes — at Version 15
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.17 |
Component: | admin/web | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Catch |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
The following behaviours should be implemented to make the Repository admin page consistent with the other admin pages:
- Call
simplify_whitespace
on thename
andalias
. - Remove leading and trailing whitespace from the
directory
andurl
.
Also:
- we should
simplify whitespace
on theComponent
owner
field. simplify_whitespace
should be extended to remove zero-width spaces (comment:5:ticket:11351).
Change History (14)
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Milestone: | next-stable-1.0.x → 1.0.3 |
---|
comment:4 by , 10 years ago
Description: | modified (diff) |
---|
comment:6 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:7 by , 9 years ago
Milestone: | 1.0.3 → next-stable-1.0.x |
---|---|
Owner: | removed |
Status: | assigned → new |
comment:9 by , 7 years ago
Milestone: | next-stable-1.0.x → next-stable-1.2.x |
---|
Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.
comment:10 by , 6 years ago
I just got hit by this issue too, annoying indeed as it's not easy to see there's a space in the name (dirname is unquoted in trac-admin error message too)
comment:11 by , 6 years ago
Replying to Ryan J Ollos:
When attempting to add an item that differs from an existing item only by whitespace, the error shown below results. For example, if attempting to add
milestone5
, butmilestone5
already exists, the traceback results. We should trap this condition and raise theTracError
, which is the typical situation when adding an existing item.
In trac/ticket/admin.py, we trap IntegrityError
on saving an item but have not trapped on adding an item for milestone, component, version, enum record.
-
trac/ticket/admin.py
diff --git a/trac/ticket/admin.py b/trac/ticket/admin.py index 06f1273f5..b5b513c77 100644
a b class MilestoneAdminPanel(TicketAdminPanel): 286 286 mil.due = user_time(req, parse_date, 287 287 req.args.get('duedate'), 288 288 hint='datetime') 289 mil.insert() 290 add_notice(req, _('The milestone "%(name)s" has been ' 291 'added.', name=name)) 289 try: 290 mil.insert() 291 except self.env.db_exc.IntegrityError: 292 raise TracError(_('Milestone "%(name)s" already ' 293 'exists.', name=name)) 294 else: 295 add_notice(req, _('The milestone "%(name)s" has ' 296 'been added.', name=name)) 292 297 else: 293 298 if mil.name is None: 294 299 raise TracError(_('Invalid milestone name.'))
Proposed changes in [a18914a42/jomae.git] (jomae.git@t11371).
comment:12 by , 6 years ago
comment:11 changes look good. For trunk, we'll need to catch ResourceExistsError
(#11419).
comment:13 by , 6 years ago
Revised proposed changes:
1.0-stable | [47fd9b5fd/jomae.git] (jomae.git@t11371_1.0) |
1.2-stable | [37fc02f18/jomae.git] (jomae.git@t11371_1.2) |
trunk | [a0dd4b9c9/jomae.git] (jomae.git@t11371_trunk) |
comment:15 by , 6 years ago
Milestone: | next-stable-1.2.x → 1.0.17 |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | new → closed |
Thanks for the reviewing. Applied in [16502] and merged in [16503-16504].
Also there are some issues mentioned in comment:2:ticket:11351 and comment:4:ticket:11297 that we may want to explore in this ticket.