wevote / WeVoteServer

We Vote's API application server written in Django/Python. Election data pulled from many sources, used by https://github.com/wevote/WebApp and https://github.com/wevote/WeVoteCordova and https://github.com/wevote/Campaigns.
https://api.wevoteusa.org
MIT License
50 stars 451 forks source link

Create move_donation_info_to_another_voter function in donate/controller.py #305

Closed DaleMcGrew closed 7 years ago

DaleMcGrew commented 7 years ago

Please create a function in donate/controller.py called "move_donation_info_to_another_voter". Please call this function near the bottom of "voter_merge_two_accounts_for_api" in voter/controllers.py. This function should result in donations and donation history information that are spread across two voters to be merged into a single voter:

Let's discuss problem cases that might arise.

SailingSteve commented 7 years ago

Sure. I would like to get basic Webhook data flowing first -- at that point all the data in postgres would stay current, including subscription expiration status.

SailingSteve commented 7 years ago

This has been implemented

DaleMcGrew commented 7 years ago

Hi Steve, I took a closer look at "move_donations_between_donors" in donate/models.py and it only seems to be moving entries from the DonationJournal. We need to move/update data from DonateLinkToVoter, DonationFromVoter, DonationLog, and DonationSubscription.

DaleMcGrew commented 7 years ago

Thank you @SailingSteve for your recent check in that finishes cancelling donations and refunding subscriptions. Will you have time to work on this issue next?

SailingSteve commented 7 years ago

Still cleaning up existing code, but I will get to this next.

SailingSteve commented 7 years ago

@DaleMcGrew

If this needs more work, I would be happy to do it.

DaleMcGrew commented 7 years ago

Thank you Steve, these changes look great. Feel free to remove the tables/classes that you think we don't need. So you are saying that DonationJournal is the only donation table with voter data? If so we can close this issue.

SailingSteve commented 7 years ago

DonationJournal is the only table we need. DonationPlanDefiniton is still used, but is vestigial. If it were worth it, it could be removed with a few hours of work. Closing for now.