Skip to content

Commit

Permalink
fix auto-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Sep 14, 2017
1 parent b41386e commit 44329ad
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
2 changes: 0 additions & 2 deletions src/openprocurement/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ def read_json(name):

CPV_ITEMS_CLASS_FROM = datetime(2017, 1, 1, tzinfo=TZ)
CPV_BLOCK_FROM = datetime(2017, 6, 1, tzinfo=TZ)

ITEMS_LOCATION_VALIDATION_FROM = datetime(2016, 11, 22, tzinfo=TZ)
33 changes: 0 additions & 33 deletions src/openprocurement/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from openprocurement.api.utils import get_now, set_parent, get_schematics_document
from openprocurement.api.constants import (
CPV_CODES, ORA_CODES, TZ, DK_CODES, CPV_BLOCK_FROM,
ITEMS_LOCATION_VALIDATION_FROM, COORDINATES_REG_EXP,
)

schematics_default_role = SchematicsDocument.Options.roles['default'] + blacklist("__parent__")
Expand Down Expand Up @@ -260,38 +259,6 @@ class Location(Model):
longitude = BaseType(required=True)
elevation = BaseType()

def validate_latitude(self, data, latitude):
if latitude:
parent_object = data.get('__parent__', {}).get('__parent__', {})
if (parent_object.get('revisions') and
parent_object['revisions'][0].date >
ITEMS_LOCATION_VALIDATION_FROM):
valid_latitude = COORDINATES_REG_EXP.match(str(latitude))
if (valid_latitude is not None and
valid_latitude.group() == str(latitude)):
if not -90 <= float(latitude) <= 90:
raise ValidationError(
u"Invalid value. Latitude must be between -90 and 90 degree.")
else:
raise ValidationError(
u"Invalid value. Required latitude format 12.0123456789")

def validate_longitude(self, data, longitude):
if longitude:
parent_object = data.get('__parent__', {}).get('__parent__', {})
if (parent_object.get('revisions') and
parent_object['revisions'][0].date >
ITEMS_LOCATION_VALIDATION_FROM):
valid_longitude = COORDINATES_REG_EXP.match(str(longitude))
if (valid_longitude is not None and
valid_longitude.group() == str(longitude)):
if not -180 <= float(longitude) <= 180:
raise ValidationError(
u"Invalid value. Longitude must be between -180 and 180 degree.")
else:
raise ValidationError(
u"Invalid value. Required longitude format 12.0123456789")


class HashType(StringType):

Expand Down

0 comments on commit 44329ad

Please sign in to comment.