Skip to content

Commit

Permalink
Fixed complaints unblock rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Jan 29, 2016
1 parent 063543f commit 9c84e38
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions openprocurement/tender/openua/views/complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def patch(self):
elif self.request.authenticated_role == 'reviewers' and self.context.status == 'pending' and data.get('status', self.context.status) == 'invalid':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateDecision = get_now()
tender.tenderPeriod.endDate = datetime.combine(self.context.dateDecision.date(), time(0, tzinfo=self.context.dateDecision.tzinfo)) + timedelta(days=3)
tender.auctionPeriod.startDate = None
tenderPeriodendDate = datetime.combine(self.context.dateDecision.date(), time(0, tzinfo=self.context.dateDecision.tzinfo)) + timedelta(days=3)
if tender.tenderPeriod.endDate < tenderPeriodendDate:
tender.tenderPeriod.endDate = tenderPeriodendDate
tender.auctionPeriod = None
elif self.request.authenticated_role == 'reviewers' and self.context.status == 'pending' and data.get('status', self.context.status) == 'accepted':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateAccepted = get_now()
Expand All @@ -141,8 +143,10 @@ def patch(self):
elif self.request.authenticated_role == 'reviewers' and self.context.status == 'accepted' and data.get('status', self.context.status) == 'declined':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateDecision = get_now()
tender.tenderPeriod.endDate = datetime.combine(self.context.dateDecision.date(), time(0, tzinfo=self.context.dateDecision.tzinfo)) + timedelta(days=3)
tender.auctionPeriod.startDate = None
tenderPeriodendDate = datetime.combine(self.context.dateDecision.date(), time(0, tzinfo=self.context.dateDecision.tzinfo)) + timedelta(days=3)
if tender.tenderPeriod.endDate < tenderPeriodendDate:
tender.tenderPeriod.endDate = tenderPeriodendDate
tender.auctionPeriod = None
elif self.request.authenticated_role == 'reviewers' and self.context.status == 'accepted' and data.get('status', self.context.status) == 'satisfied':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateDecision = get_now()
Expand Down

0 comments on commit 9c84e38

Please sign in to comment.