Revert "update tracked view to take id instead of URL"

This reverts commit f2c2e2d6f2.
This commit is contained in:
James Turk 2011-09-22 13:28:57 -04:00
parent eefc74815e
commit cad6ceb4f7
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<tr{% if log.error %} class="error" {% endif %}> <tr{% if log.error %} class="error" {% endif %}>
<td>{{log.action}}</td> <td>{{log.action}}</td>
<td><a href="{{request.script_root}}/tracked/{{log._id}}">{{log.url}}</td> <td><a href="{{request.script_root}}/tracked/{{log.url}}">{{log.url}}</td>
<td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td> <td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td>
<td>{% if log.error %}{{log.error}}{% endif %}</td> <td>{% if log.error %}{{log.error}}{% endif %}</td>
</tr> </tr>

View File

@ -85,9 +85,10 @@ def tracked():
return json.dumps(tracked, cls=JSONEncoder) return json.dumps(tracked, cls=JSONEncoder)
@app.route('/tracked/<id>') @app.route('/tracked/<path:url>')
def tracked_view(id): def tracked_view(url):
doc = client.db.tracked.find_one({'_id': id}) url = _path_fixer(url)
doc = client.db.tracked.find_one({'url': url})
return json.dumps(doc, cls=JSONEncoder) return json.dumps(doc, cls=JSONEncoder)