|
1 | | -#$Id: actions.py,v 1.27.2.1 2004-05-13 00:21:32 richard Exp $ |
| 1 | +#$Id: actions.py,v 1.27.2.2 2004-05-23 23:26:30 richard Exp $ |
2 | 2 |
|
3 | 3 | import re, cgi, StringIO, urllib, Cookie, time, random |
4 | 4 |
|
@@ -148,18 +148,20 @@ def handle(self, wcre=re.compile(r'[\s,]+')): |
148 | 148 | # edit the new way, query name not a key any more |
149 | 149 | # see if we match an existing private query |
150 | 150 | uid = self.db.getuid() |
151 | | - qids = self.db.query.filter({}, {'name': queryname, |
| 151 | + qids = self.db.query.filter(None, {'name': queryname, |
152 | 152 | 'private_for': uid}) |
153 | 153 | if not qids: |
154 | 154 | # ok, so there's not a private query for the current user |
155 | 155 | # - see if there's a public one created by them |
156 | | - qids = self.db.query.filter({}, {'name': queryname, |
| 156 | + qids = self.db.query.filter(None, {'name': queryname, |
157 | 157 | 'private_for': -1, 'creator': uid}) |
158 | 158 |
|
159 | 159 | if qids: |
160 | | - # edit query |
161 | | - qid = qids[0] |
162 | | - self.db.query.set(qid, klass=self.classname, url=url) |
| 160 | + # edit query - make sure we get an exact match on the name |
| 161 | + for qid in qids: |
| 162 | + if queryname != self.db.query.get(qid, 'name'): |
| 163 | + continue |
| 164 | + self.db.query.set(qid, klass=self.classname, url=url) |
163 | 165 | else: |
164 | 166 | # create a query |
165 | 167 | qid = self.db.query.create(name=queryname, |
|
0 commit comments