diff options
Diffstat (limited to 'ishtar_common/utils.py')
| -rw-r--r-- | ishtar_common/utils.py | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 49730b496..3054d4a19 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -502,14 +502,21 @@ def post_save_geo(sender, **kwargs):      from ishtar_common.models import get_current_profile  # not clean but utils      # is loaded before models +    profile = get_current_profile() +    if not profile.mapping: +        return      instance = kwargs.get('instance') +    kls_name = instance.__class__.__name__ + +    if not profile.locate_warehouses and ("Container" in kls_name +                                          or "Warehouse" in kls_name): +        return +      current_source = "default"      if hasattr(instance.__class__, "_meta"):          current_source = unicode(instance.__class__._meta.verbose_name) -    profile = get_current_profile()      modified = False -      if hasattr(instance, 'multi_polygon'):          if instance.multi_polygon_source_item and \                  instance.multi_polygon_source_item != current_source:  # refetch | 
