base_attachment_storage: _register_hook do nothing if it is disabled

This commit is contained in:
Denis Leemann committed 2023-08-22 15:00:16 +02:00
1 parent 0d0ca60710
commit d5e446b0af
1 file changed
+1 -1
@@ -59,7 +59,7 @@ class IrAttachment(models.Model):
super()._register_hook()
location = self.env.context.get("storage_location") or self._storage()
# ignore if we are not using an object storage
if location not in self._get_stores():
if self.is_storage_disabled(location) or location not in self._get_stores():
return
curframe = inspect.currentframe()
calframe = inspect.getouterframes(curframe, 2)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.