changeset 5649:45ff88d54d96

search: ignore FoundRemote instances to avoid crashes (needs more work)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 05 Apr 2010 00:33:49 +0200
parents 06908566d7bd
children 90cca4781e96
files MoinMoin/search/results.py
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/results.py	Sun Apr 04 17:10:43 2010 +0200
+++ b/MoinMoin/search/results.py	Mon Apr 05 00:33:49 2010 +0200
@@ -337,19 +337,22 @@
                 displayHits = self.hits
 
             for page in displayHits:
-                # TODO handle interwiki search hits
-                if page.attachment:
+                if isinstance(page, FoundRemote):
+                    # TODO handle FoundRemote (interwiki) search hits
+                    continue
+                elif isinstance(page, FoundAttachment):
                     querydict = {
                         'action': 'AttachFile',
                         'do': 'view',
                         'target': page.attachment,
                     }
-                elif page.rev and page.rev != page.page.getRevList()[0]:
-                    querydict = {
-                        'rev': page.rev,
-                    }
-                else:
-                    querydict = None
+                elif isinstance(page, FoundPage):
+                    if page.rev and page.rev != page.page.getRevList()[0]:
+                        querydict = {
+                            'rev': page.rev,
+                        }
+                    else:
+                        querydict = None
                 querystr = self.querystring(querydict)
 
                 matchInfo = ''