Skip to content

Commit

Permalink
Fixed extending complaint period
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Feb 15, 2016
1 parent 4675927 commit db1b562
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions openprocurement/tender/openua/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class Options:
}
status = StringType(choices=['draft', 'claim', 'answered', 'pending', 'accepted', 'invalid', 'resolved', 'declined', 'cancelled', 'satisfied', 'ignored'], default='draft')
acceptance = BooleanType()
dateAccepted = IsoDateTimeType()
rejectReason = StringType(choices=['lawNonСompliance', 'noPaymentReceived', 'buyerViolationsСorrected'])
rejectReasonDescription = StringType()
reviewDate = IsoDateTimeType()
Expand Down
7 changes: 1 addition & 6 deletions openprocurement/tender/openua/views/award_complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ 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()
if complaintPeriod.endDate:
complaintPeriodendDate = complaintPeriod.endDate + (self.context.dateDecision - self.context.dateSubmitted)
complaintPeriodendDate = datetime.combine(complaintPeriodendDate.date(), time(0, tzinfo=complaintPeriodendDate.tzinfo)) + timedelta(days=1)
if complaintPeriod.endDate < complaintPeriodendDate:
complaintPeriod.endDate = complaintPeriodendDate
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 @@ -139,7 +134,7 @@ def patch(self):
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateDecision = get_now()
if complaintPeriod.endDate:
complaintPeriodendDate = complaintPeriod.endDate + (self.context.dateDecision - self.context.dateSubmitted)
complaintPeriodendDate = complaintPeriod.endDate + (self.context.dateDecision - self.context.dateAccepted)
complaintPeriodendDate = datetime.combine(complaintPeriodendDate.date(), time(0, tzinfo=complaintPeriodendDate.tzinfo)) + timedelta(days=1)
if complaintPeriod.endDate < complaintPeriodendDate:
complaintPeriod.endDate = complaintPeriodendDate
Expand Down

0 comments on commit db1b562

Please sign in to comment.