diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 283fca29ac7..c9f51a5b99e 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -207,7 +207,20 @@ def url(self): @property def can_submit_after_expiration_date(self): - return self.is_legacy or self.raw_data.get('payload', {}).get('expire_date', False) + if self.is_legacy: + # legacy bounties could submit after expirration date + return True + + # standardbounties + contract_deadline = self.raw_data.get('contract_deadline', False) + ipfs_deadline = self.raw_data.get('ipfs_deadline', False) + if not ipfs_deadline: + # if theres no expiry date in the payload, then expiration date is not mocked, and one cannot submit after expiration date + return False + + # if contract_deadline > ipfs_deadline, then by definition, can be submitted after expiry date + return contract_deadline > ipfs_deadline + @property def title_or_desc(self): diff --git a/app/dashboard/utils.py b/app/dashboard/utils.py index 610b6c07e16..8e0c1d99f2f 100644 --- a/app/dashboard/utils.py +++ b/app/dashboard/utils.py @@ -136,7 +136,7 @@ def get_bounty(bounty_enum, network): standard_bounties = getBountyContract(network) try: - issuer, deadline, fulfillmentAmount, paysTokens, bountyStage, balance = standard_bounties.functions.getBounty(bounty_enum).call() + issuer, contract_deadline, fulfillmentAmount, paysTokens, bountyStage, balance = standard_bounties.functions.getBounty(bounty_enum).call() except BadFunctionCallOutput: raise BountyNotFoundException @@ -173,15 +173,18 @@ def get_bounty(bounty_enum, network): raise IPFSCantConnectException("Failed to connect to IPFS") # https://github.com/Bounties-Network/StandardBounties/issues/25 - override_deadline = bounty_data.get('payload', {}).get('expire_date', False) - if override_deadline: - deadline = override_deadline + ipfs_deadline = bounty_data.get('payload', {}).get('expire_date', False) + deadline = contract_deadline + if ipfs_deadline: + deadline = ipfs_deadline # assemble the data bounty = { 'id': bounty_enum, 'issuer': issuer, 'deadline': deadline, + 'contract_deadline': contract_deadline, + 'ipfs_deadline': ipfs_deadline, 'fulfillmentAmount': fulfillmentAmount, 'paysTokens': paysTokens, 'bountyStage': bountyStage,