Skip to content

Commit

Permalink
dont set uncapped milestone status to PAID
Browse files Browse the repository at this point in the history
  • Loading branch information
ewingrj committed Jan 31, 2019
1 parent e8f3c72 commit c0ee147
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/blockchain/milestones.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ const milestonesFactory = app => {
return;
}

// never set uncapped milestones as PAID
if (!milestones[0].maxAmount) return;

const donations = await app.service('donations').find({
paginate: false,
query: {
Expand Down
4 changes: 4 additions & 0 deletions src/services/donations/donations.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ const updateMilestoneIfNotPledged = () => async context => {
donation.ownerType === AdminTypes.MILESTONE &&
[DonationStatus.PAYING, DonationStatus.PAID].includes(donation.status)
) {
const milestone = await context.app.service('milestones').get(donation.ownerTypeId);
// never set uncapped milestones as PAID
if (!milestone.maxAmount) return;

const donations = await context.app.service('donations').find({
paginate: false,
query: {
Expand Down

0 comments on commit c0ee147

Please sign in to comment.