#11597 closed enhancement (fixed)
Allow setting default_handler as a session preference — at Version 7
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | session, preferences, default_handler |
Cc: | Branch: | ||
Release Notes: |
The |
||
API Changes: | |||
Internal Changes: |
Description
The proposed feature will make it possible to set the default_handler
from the Preferences page or using a TracAdmin command (trac-admin
session set
). The feature was previously mentioned in comment:17:ticket:11519.
Together with an enhancement to be proposed to the th:AccountManagerPlugin, this will support convenient configuration of a use-case for which I've previously used the th:GroupBasedRedirectionPlugin - having members of groups/teams arrive at different pages when logging in to Trac.
Change History (7)
comment:1 by , 10 years ago
Status: | new → assigned |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
I don't think the selected handler is always valid for default handler. I think we should check whether the handler is valid.
-
trac/web/main.py
diff --git a/trac/web/main.py b/trac/web/main.py index 3303337..6574b66 100644
a b class RequestDispatcher(Component): 276 276 # Use default_handler from the Session if it is a valid value. 277 277 name = req.session.get('default_handler') 278 278 handler = self._request_handlers.get(name) 279 if handler and not is_valid_default_handler(handler): 280 handler = None 279 281 280 282 if not handler: 281 283 # Use default_handler from project configuration.
comment:5 by , 10 years ago
log:rjollos.git:t11597.2 contains some refactoring of the proposed changes. Functional tests still need to be added.
comment:6 by , 10 years ago
Proposed changes in log:rjollos.git:t11597.3, with functional and unit tests.
comment:7 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [12922].
The core functionality has been implemented in log:rjollos.git:t11597. However, I'll add tests before committing.