Simplify logic.

This commit is contained in:
Will O'Beirne 2019-02-19 12:19:47 -05:00
parent ea35f7874c
commit af7bc08828
No known key found for this signature in database
GPG Key ID: 44C190DB5DEAF9F6
3 changed files with 4 additions and 5 deletions

View File

@ -69,7 +69,8 @@ class ContributionDetail extends React.Component<Props, State> {
</p>
<pre>{c.refundAddress}</pre>
<p>
They will be sent an email notifying them of the refund.
They will be sent an email notifying them of the refund when you
enter the txid below.
</p>
<Input.Search
placeholder="Enter payment txid"

View File

@ -87,8 +87,7 @@ def stats():
# Count contributions on proposals that didn't get funded for users who have specified a refund address
contribution_refundable_count = db.session.query(func.count(ProposalContribution.id)) \
.join(Proposal) \
.filter(Proposal.stage == ProposalStage.FUNDING_REQUIRED) \
.filter(Proposal.date_published + timedelta(seconds=1) * Proposal.deadline_duration < datetime.now()) \
.filter(Proposal.stage == ProposalStage.REFUNDING) \
.join(ProposalContribution.user) \
.join(UserSettings) \
.filter(UserSettings.refund_address != None) \

View File

@ -153,8 +153,7 @@ class ContributionPagination(Pagination):
if 'REFUNDABLE' in filters:
query = query.join(Proposal) \
.filter(Proposal.stage == ProposalStage.FUNDING_REQUIRED) \
.filter(Proposal.date_published + timedelta(seconds=1) * Proposal.deadline_duration < datetime.now()) \
.filter(Proposal.stage == ProposalStage.REFUNDING) \
.join(ProposalContribution.user) \
.join(UserSettings) \
.filter(UserSettings.refund_address != None) \