Skip to content

Commit

Permalink
fix missing constants
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Sep 12, 2017
1 parent fb95298 commit b41386e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/openprocurement/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

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
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 @@ -265,7 +266,7 @@ def validate_latitude(self, data, latitude):
if (parent_object.get('revisions') and
parent_object['revisions'][0].date >
ITEMS_LOCATION_VALIDATION_FROM):
valid_latitude = coordinates_reg_exp.match(str(latitude))
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:
Expand All @@ -281,7 +282,7 @@ def validate_longitude(self, data, longitude):
if (parent_object.get('revisions') and
parent_object['revisions'][0].date >
ITEMS_LOCATION_VALIDATION_FROM):
valid_longitude = coordinates_reg_exp.match(str(longitude))
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:
Expand Down

0 comments on commit b41386e

Please sign in to comment.