diff --git a/apps/versions/models.py b/apps/versions/models.py index d28aa5bf2e..cb22eecd87 100644 --- a/apps/versions/models.py +++ b/apps/versions/models.py @@ -438,12 +438,18 @@ def cleanup_version(sender, instance, **kw): def clear_compatversion_cache_on_save(sender, instance, created, **kw): """Clears compatversion cache if new Version created.""" + if not instance.addon.type == amo.ADDON_EXTENSION: + return + if not kw.get('raw') and created: instance.addon.invalidate_d2c_versions() def clear_compatversion_cache_on_delete(sender, instance, **kw): """Clears compatversion cache when Version deleted.""" + if not instance.addon.type == amo.ADDON_EXTENSION: + return + if not kw.get('raw'): instance.addon.invalidate_d2c_versions()