Skip to content

Commit cf1860e

Browse files
committed
Add cached_property
1 parent 9710ec2 commit cf1860e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_editorjs/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from re import match
33

44
from django.forms import Media, widgets
5+
from django.utils.functional import cached_property
56
from django.utils.safestring import mark_safe
67

78
from .config import DEFAULT_CONFIG_PLUGINS, DEFAULT_PLUGINS
@@ -14,9 +15,8 @@ def __init__(self, version, plugins=None, tools=None, **kwargs):
1415
self.tools = tools or {}
1516
super().__init__(**kwargs)
1617

17-
@property
18+
@cached_property
1819
def media(self):
19-
2020
plugins = self.plugins
2121
custom_tools = self.tools
2222
_tools = {}

0 commit comments

Comments
 (0)