Skip to content

Commit

Permalink
Added Contract.date
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed May 12, 2016
1 parent 0d7f132 commit f314cf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/openprocurement/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ class Options:
documents = ListType(ModelType(Document), default=list())
items = ListType(ModelType(Item))
suppliers = ListType(ModelType(Organization), min_size=1, max_size=1)
date = IsoDateTimeType(default=get_now)

def validate_awardID(self, data, awardID):
if awardID and isinstance(data['__parent__'], Model) and awardID not in [i.id for i in data['__parent__'].awards]:
Expand Down
1 change: 1 addition & 0 deletions src/openprocurement/api/views/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def patch(self):
return
contract_status = self.request.context.status
apply_patch(self.request, save=False, src=self.request.context.serialize())
self.request.context.date = get_now()
if contract_status != self.request.context.status and (contract_status != 'pending' or self.request.context.status != 'active'):
self.request.errors.add('body', 'data', 'Can\'t update contract status')
self.request.errors.status = 403
Expand Down

0 comments on commit f314cf0

Please sign in to comment.