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

Update apps/challenges/migrations/0044_move_votes_to_parents.py #69

Merged
merged 1 commit into from Aug 22, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/challenges/migrations/0044_move_votes_to_parents.py
Expand Up @@ -16,6 +16,11 @@ def forwards(self, orm):
votes = Vote.objects.filter(content_type=submission_model)
# Iterate over the existing votes
for vote in votes:
# Ignore votes that don't have a submission object
# Not having a object means that the submission has been
# removed.
if not vote.object:
continue
# change the vote to be in the parent
parent = vote.object.parent
vote.object = parent
Expand Down