[boundaries] adding check for valid name key in formatted places, and removing short_name from the Sao Paulo relation as well

This commit is contained in:
Al
2017-01-12 12:05:42 -05:00
parent f218e43adc
commit ba0f097d78
3 changed files with 19 additions and 1 deletions

View File

@@ -110,6 +110,9 @@ class BoundaryNames(object):
def _string_as_regex(self, s):
return safe_decode(s).replace(six.u('.'), six.u('\\.'))
def valid_name(self, object_type, object_id, name):
return name in self.exceptions.get((object_type, object_id), ((), ()))[0]
def name_key_dist(self, props, component):
object_type = props.get('type')
object_id = safe_encode(props.get('id', ''))