aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/models.py
diff options
context:
space:
mode:
authorCaleb Forbes Davis V <caldavis@gmail.com>2011-07-05 21:33:02 -0500
committerCaleb Forbes Davis V <caldavis@gmail.com>2011-07-05 21:33:02 -0500
commitce2ac488263470270dea8619c88de648831b06ec (patch)
treee75217dc9b2b8df2d8b2be3a555fe09920841106 /mediagoblin/db/models.py
parent5ed4722de8106a512a4faacfedaae7b8eda7260b (diff)
downloadmediagoblin-ce2ac488263470270dea8619c88de648831b06ec.tar.lz
mediagoblin-ce2ac488263470270dea8619c88de648831b06ec.tar.xz
mediagoblin-ce2ac488263470270dea8619c88de648831b06ec.zip
f#435 - avoids linking to unprocessed media in prev and next
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r--mediagoblin/db/models.py6
1 files 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():