Skip to content

Commit

Permalink
Fixed dateSigned validation for reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Apr 7, 2016
1 parent caf25b6 commit 8d6f904
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openprocurement/tender/limited/tests/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def test_tender_contract_signature_date(self):
self.assertEqual(response.status, '422 Unprocessable Entity')
self.assertEqual(response.json['errors'], [{u'description': [u"Contract signature date can't be in the future"], u'location': u'body', u'name': u'dateSigned'}])

twenty_five_hours_in_past = (get_now() - timedelta(hours=25)).isoformat()
twenty_five_hours_in_past = (get_now() - timedelta(hours=25*14)).isoformat()
response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(self.tender_id, self.contract_id, self.tender_token), {"data": {"dateSigned": twenty_five_hours_in_past}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.content_type, 'application/json')
Expand Down
2 changes: 1 addition & 1 deletion openprocurement/tender/limited/views/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def patch(self):
return

if self.request.context.dateSigned != contract_dateSigned:
if self.request.context.dateSigned < (get_now() - timedelta(days=1)):
if self.request.context.dateSigned < (get_now() - timedelta(days=14)):
self.request.errors.add('body', 'data', 'dateSigned has to be within the period of 24 hours before the current date')
self.request.errors.status = 403
return
Expand Down

0 comments on commit 8d6f904

Please sign in to comment.