diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index eccee99c..2a051a09 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -19,6 +19,7 @@ from grant.utils.misc import is_email, make_url, from_zat from grant.utils.enums import ProposalStatus, ContributionStatus from grant.utils import pagination from sqlalchemy import or_ +from datetime import datetime from .models import ( Proposal, @@ -216,7 +217,7 @@ def update_proposal(milestones, proposal_id, **kwargs): m = Milestone( title=mdata["title"], content=mdata["content"], - date_estimated=parse(mdata["dateEstimated"]), + date_estimated=datetime.fromtimestamp(mdata["dateEstimated"]), payout_percent=str(mdata["payoutPercent"]), immediate_payout=mdata["immediatePayout"], proposal_id=g.current_proposal.id diff --git a/backend/tests/test_data.py b/backend/tests/test_data.py index ebf22952..2f1c0d54 100644 --- a/backend/tests/test_data.py +++ b/backend/tests/test_data.py @@ -31,7 +31,7 @@ milestones = [ { "title": "All the money straightaway", "content": "cool stuff with it", - "dateEstimated": "Fri, 30 Nov 2018 01:42:23 GMT", + "dateEstimated": 1549505307, "payoutPercent": "100", "immediatePayout": False }