Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
hotfix to allow setting start_from_id in update_votes command
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Nov 16, 2015
1 parent 76291e0 commit 977a0c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simple/management/commands/syncdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def update_votes(self, start_from_id=None, force_download=False):
logger.warning("DB is empty. --update can only be used to update, not for first time loading. \ntry --all, or get some data using initial_data.json\n")
return
vote_id = start_from_id or current_max_src_id+1 # first vote to look for is the max_src_id we have plus 1, if not manually set
limit_src_id = current_max_src_id + 100 # look for next 100 votes. if results are found, this value will be incremented.
limit_src_id = vote_id + 100 # look for next 100 votes. if results are found, this value will be incremented.
while vote_id < limit_src_id:
if not force_download and Vote.objects.filter(src_id=vote_id).count(): # we already have this vote
logger.debug('skipping reading vote with src_id %d, because we already have it' % vote_id)
Expand Down

0 comments on commit 977a0c3

Please sign in to comment.