#11355 closed defect (fixed)
Save from repository admin detail page with no changes doesn't redirect to the listing page
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | admin/web | Version: | 1.0-stable |
Severity: | normal | Keywords: | repository |
Cc: | Branch: | ||
Release Notes: |
Pressing Save on Repository Admin edit page when no change is made redirects back to the listing page. |
||
API Changes: | |||
Internal Changes: |
Description
Pressing Save when no changes have been made to a repository doesn't redirect back to the repository listing page. This appears to be a side-effect of the changes in [10042]. The other admin pages such as Ticket Components redirect back to the listing page when no changes have been made.
Attachments (0)
Change History (8)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Status: | new → assigned |
---|
comment:3 by , 11 years ago
LGTM, however I have one thing. value &= ....
, it seems the trick. It would be simple to be the following.
-
trac/versioncontrol/admin.py
diff --git a/trac/versioncontrol/admin.py b/trac/versioncontrol/admin.py index 28d96c1..650e120 100644
a b class RepositoryAdminPanel(Component): 206 206 if (value is not None or field == 'hidden') \ 207 207 and value != info.get(field): 208 208 changes[field] = value 209 if 'dir' in changes: 210 valid &= self._check_dir(req, changes['dir']) 209 if 'dir' in changes \ 210 and not self._check_dir(req, changes['dir']): 211 valid = False 211 212 if valid and changes: 212 213 db_provider.modify_repository(reponame, changes) 213 214 add_notice(req, _('Your changes have been saved.'))
comment:4 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:5 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
In [12231], the valid
variable never be set False
. After the changes, if submitting non absolute path as repository directory in modify repository view, TracError
would wrongly be shown. Before the changes, the modify repository view would be shown.
comment:6 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:7 by , 11 years ago
I've found the following failure, fixed in [12251] and merged in [12252]. dir.lstrip('/')
would be still absolute path on Windows.
====================================================================== FAIL: Test for regression of http://trac.edgewall.org/ticket/11355 ---------------------------------------------------------------------- Traceback (most recent call last): File "trac\versioncontrol\tests\functional.py", line 274, in runTest tc.url(self._tester.url + '/admin/versioncontrol/repository/' + name) File "C:\usr\src\trac\trac.git\trac\tests\functional\better_twill.py", line 236, in better_url raise twill.errors.TwillAssertionError(*args) TwillAssertionError: ("current url is 'http://127.0.0.1:8032/admin/versioncontrol/repository';\ndoes not match 'http://127.0.0.1:8032/admin/versioncontrol/repository/EightOne'\n", 'C:\\usr\\src\\trac\\trac.git\\testenv\\trac\\log\\RegressionTestTicket11355.html')
comment:8 by , 10 years ago
Release Notes: | modified (diff) |
---|
I debated several ways to fix this, including adding a
if not changes: req.redirect(req.href.admin(category, page))
early in the function. Ultimately I felt that adding thevalid
variable was the cleanest solution, and may prove more useful if other validity checks are added. Let me know if the code doesn't seem clear, or there is a better way.Proposed changes can be found in log:rjollos.git:t11355.