From ce2ac488263470270dea8619c88de648831b06ec Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Tue, 5 Jul 2011 21:33:02 -0500 Subject: [PATCH] f#435 - avoids linking to unprocessed media in prev and next --- mediagoblin/db/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 8aa35ca9..3bd1f61f 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -148,7 +148,8 @@ class MediaEntry(Document): Provide a url to the previous entry from this user, if there is one """ cursor = self.db.MediaEntry.find({'_id' : {"$lt": self['_id']}, - 'uploader': self['uploader']}).sort( + 'uploader': self['uploader'], + 'state': 'processed'}).sort( '_id', DESCENDING).limit(1) if cursor.count(): @@ -161,7 +162,8 @@ class MediaEntry(Document): Provide a url to the next entry from this user, if there is one """ cursor = self.db.MediaEntry.find({'_id' : {"$gt": self['_id']}, - 'uploader': self['uploader']}).sort( + 'uploader': self['uploader'], + 'state': 'processed'}).sort( '_id', ASCENDING).limit(1) if cursor.count(): -- 2.25.1