Skip to content

Commit

Permalink
Typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Jan 22, 2016
1 parent f0efe8f commit 5eb174e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions openprocurement/tender/openua/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from openprocurement.tender.openua.interfaces import ITenderUA
from schematics.exceptions import ValidationError
from openprocurement.tender.openua.utils import calculate_buisness_date
from openprocurement.tender.openua.utils import calculate_business_date
from schematics.types.serializable import serializable


Expand Down Expand Up @@ -229,18 +229,18 @@ class Options:
status = StringType(choices=['active.tendering', 'active.auction', 'active.qualification', 'active.awarded', 'complete', 'cancelled', 'unsuccessful'], default='active.tendering')

def validate_enquiryPeriod(self, data, period):
if period and calculate_buisness_date(period.endDate, -timedelta(days=12)) < period.startDate:
if period and calculate_business_date(period.endDate, -timedelta(days=12)) < period.startDate:
raise ValidationError(u"enquiryPeriod should be greater than 12 days")

def validate_tenderPeriod(self, data, period):
if period and calculate_buisness_date(period.endDate, -timedelta(days=15)) < period.startDate:
if period and calculate_business_date(period.endDate, -timedelta(days=15)) < period.startDate:
raise ValidationError(u"tenderPeriod should be greater than 15 days")

def initialize(self):
if not self.tenderPeriod.startDate:
self.tenderPeriod.startDate = get_now()
self.enquiryPeriod = Period(self.tenderPeriod.to_native())
self.enquiryPeriod.endDate = calculate_buisness_date(self.tenderPeriod.endDate, -timedelta(days=3))
self.enquiryPeriod.endDate = calculate_business_date(self.tenderPeriod.endDate, -timedelta(days=3))
if hasattr(self, "auctionPeriod") and hasattr(self.auctionPeriod, "startDate"):
self.auctionPeriod.startDate = ""

Expand Down
6 changes: 2 additions & 4 deletions openprocurement/tender/openua/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
from logging import getLogger
from openprocurement.api.models import get_now, TZ
from openprocurement.api.utils import (
check_bids,
check_tender_status,
context_unpack,
add_next_award
)

PKG = get_distribution(__package__)
Expand All @@ -24,11 +22,10 @@ def get_invalidated_bids_data(request):
return data


def calculate_buisness_date(date_obj, timedelta_obj):
def calculate_business_date(date_obj, timedelta_obj):
return date_obj + timedelta_obj



def check_bids(request):
tender = request.validated['tender']
if tender.lots:
Expand All @@ -39,6 +36,7 @@ def check_bids(request):
if tender.numberOfBids < 2:
tender.status = 'unsuccessful'


def check_status(request):
tender = request.validated['tender']
now = get_now()
Expand Down
4 changes: 2 additions & 2 deletions openprocurement/tender/openua/views/lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
validate_patch_lot_data,
)
from openprocurement.api.models import get_now
from openprocurement.tender.openua.utils import calculate_buisness_date
from openprocurement.tender.openua.utils import calculate_business_date

LOGGER = getLogger(__name__)

Expand All @@ -34,7 +34,7 @@ def validate_update_tender(self, operation):
self.request.errors.add('body', 'data', 'Can\'t {} lot in current ({}) tender status'.format(operation, tender.status))
self.request.errors.status = 403
return
if calculate_buisness_date(get_now(), timedelta(days=7)) > tender.tenderPeriod.endDate:
if calculate_business_date(get_now(), timedelta(days=7)) > tender.tenderPeriod.endDate:
self.request.errors.add('body', 'data', 'tenderPeriod should be extended by 7 days')
self.request.errors.status = 403
return
Expand Down
4 changes: 2 additions & 2 deletions openprocurement/tender/openua/views/tender.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from openprocurement.tender.openua.utils import (
get_invalidated_bids_data,
check_status,
calculate_buisness_date
calculate_business_date
)
from openprocurement.api.utils import (
save_tender,
Expand Down Expand Up @@ -91,7 +91,7 @@ def patch(self):
if self.request.authenticated_role == 'tender_owner' and self.request.validated['tender_status'] == 'active.tendering':
if 'tenderPeriod' in data and 'endDate' in data['tenderPeriod']:
self.request.validated['tender'].tenderPeriod.import_data(data['tenderPeriod'])
if calculate_buisness_date(get_now(), timedelta(days=7)) > self.request.validated['tender'].tenderPeriod.endDate:
if calculate_business_date(get_now(), timedelta(days=7)) > self.request.validated['tender'].tenderPeriod.endDate:
self.request.errors.add('body', 'data', 'tenderPeriod should be extended by 7 days')
self.request.errors.status = 403
return
Expand Down
4 changes: 2 additions & 2 deletions openprocurement/tender/openua/views/tender_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from openprocurement.api.validation import validate_file_upload, validate_file_update, validate_patch_document_data
from openprocurement.api.models import get_now

from openprocurement.tender.openua.utils import calculate_buisness_date
from openprocurement.tender.openua.utils import calculate_business_date
LOGGER = getLogger(__name__)


Expand All @@ -25,7 +25,7 @@ def validate_update_tender(self, operation):
self.request.errors.status = 403
return
if self.request.validated['tender_status'] == 'active.tendering':
if calculate_buisness_date(get_now(), timedelta(days=7)) >= tender.tenderPeriod.endDate:
if calculate_business_date(get_now(), timedelta(days=7)) >= tender.tenderPeriod.endDate:
self.request.errors.add('body', 'data', 'tenderPeriod should be extended by 7 days')
self.request.errors.status = 403
return
Expand Down

0 comments on commit 5eb174e

Please sign in to comment.