Skip to content

Commit

Permalink
Merge branch 'a147507835786738_normal_days'
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Jul 25, 2016
2 parents f2e07f3 + eeccfa8 commit 23ba4cc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions openprocurement/tender/limited/views/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,12 @@ def patch(self):
award = self.request.context
award_status = award.status
apply_patch(self.request, save=False, src=self.request.context.serialize())
award.date = get_now()
if award.status == "active" and not award.qualified:
self.request.errors.add('body', 'data', 'Can\'t update award to active status with not qualified')
self.request.errors.status = 403
return
if award_status == 'pending' and award.status == 'active':
normalized_end = calculate_normalized_date(award.date, tender, True)
normalized_end = calculate_normalized_date(get_now(), tender, True)
award.complaintPeriod.endDate = calculate_business_date(normalized_end, self.stand_still_delta, tender)
tender.contracts.append(type(tender).contracts.model_class({
'awardID': award.id,
Expand All @@ -551,7 +550,7 @@ def patch(self):
i.status = 'cancelled'
# add_next_award(self.request)
elif award_status == 'pending' and award.status == 'unsuccessful':
normalized_end = calculate_normalized_date(award.date, tender, True)
normalized_end = calculate_normalized_date(get_now(), tender, True)
award.complaintPeriod.endDate = calculate_business_date(normalized_end, self.stand_still_delta, tender)
# add_next_award(self.request)
elif award_status == 'unsuccessful' and award.status == 'cancelled' and any([i.status == 'satisfied' for i in award.complaints]):
Expand Down

0 comments on commit 23ba4cc

Please sign in to comment.