| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Trac
Revision: 7503
Author: rblank
Date: 31 Aug 2008 20:14:41
Diff at Trac: http://trac.edgewall.org/changeset/7503
Changes:Merged [7502] from 0.11-stable.
Files:| ... | ...@@ -742,24 +742,25 @@ | |
| 742 | 742 | if not constraints and not 'order' in req.args: |
| 743 | 743 | # If no constraints are given in the URL, use the default ones. |
| 744 | 744 | if req.authname and req.authname != 'anonymous': |
| 745 | qstring = self.default_query | |
| 746 | user = req.authname | |
| 745 | qstring = self.default_query | |
| 746 | user = req.authname | |
| 747 | 747 | else: |
| 748 | 748 | email = req.session.get('email') |
| 749 | 749 | name = req.session.get('name') |
| 750 | qstring = self.default_anonymous_query | |
| 751 | user = email or name or None | |
| 750 | qstring = self.default_anonymous_query | |
| 751 | user = email or name or None | |
| 752 | 752 | |
| 753 | if user: | |
| 754 | qstring = qstring.replace('$USER', user) | |
| 755 | self.log.debug('QueryModule: Using default query: %s', str(qstring)) | |
| 756 | constraints = Query.from_string(self.env, qstring).constraints | |
| 757 | # Ensure no field constraints that depend on $USER are used | |
| 758 | # if we have no username. | |
| 759 | for field, vals in constraints.items(): | |
| 760 | for val in vals: | |
| 761 | if val.endswith('$USER'): | |
| 762 | del constraints[field] | |
| 753 | self.log.debug('QueryModule: Using default query: %s', str(qstring)) | |
| 754 | constraints = Query.from_string(self.env, qstring).constraints | |
| 755 | # Substitute $USER, or ensure no field constraints that depend on | |
| 756 | # $USER are used if we have no username. | |
| 757 | for field, vals in constraints.items(): | |
| 758 | for (i, val) in enumerate(vals): | |
| 759 | if user: | |
| 760 | vals[i] = val.replace('$USER', user) | |
| 761 | elif val.endswith('$USER'): | |
| 762 | del constraints[field] | |
| 763 | break | |
| 763 | 764 | |
| 764 | 765 | cols = req.args.get('col') |
| 765 | 766 | if isinstance(cols, basestring): |