Fix dump_pointers on last time.

(imported from commit c16686492e5acd699976268cb48c0290099688cc)
This commit is contained in:
Tim Abbott 2012-12-15 09:28:22 -05:00
parent 35226c352d
commit 95f4087a06
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
from optparse import make_option
from django.core.management.base import BaseCommand
from zephyr.models import Realm, UserProfile, Message
from zephyr.models import Realm, UserProfile, Message, UserMessage
from zephyr.lib.time import datetime_to_timestamp, timestamp_to_datetime
import simplejson
@ -26,8 +26,8 @@ def restore(change):
pointer = -1
else:
try:
pointer = Message.objects.filter(
pub_date__gte=timestamp_to_datetime(timestamp - 1)).order_by("id")[0].id
pointer = UserMessage.objects.filter(user_profile=u,
message__pub_date__gte=timestamp_to_datetime(timestamp)).order_by("message")[0].message_id
except IndexError:
print "Alert...", email, timestamp
continue