Skip to content

Commit

Permalink
activity migraiton on bounty
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Jul 9, 2018
1 parent 3fcf5e4 commit 7679f15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/dashboard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,16 @@ def create_new_bounty(old_bounties, bounty_payload, bounty_details, bounty_id):
)
new_bounty.fetch_issue_item()

# Pull the interested parties off the last old_bounty
# migrate data objects from old bounty
if latest_old_bounty:
# Pull the interested parties off the last old_bounty
for interest in latest_old_bounty.interested.all():
new_bounty.interested.add(interest)

# pull the activities off the last old bounty
for activity in latest_old_bounty.activities.all():
new_bounty.activities.add(activity)

# set cancel date of this bounty
canceled_on = latest_old_bounty.canceled_on if latest_old_bounty and latest_old_bounty.canceled_on else None
if not canceled_on and new_bounty.status == 'cancelled':
Expand Down

0 comments on commit 7679f15

Please sign in to comment.