File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,23 @@ class LocalizedBleachField(LocalizedField):
9
9
"""Custom version of :see:BleachField that is actually a
10
10
:see:LocalizedField."""
11
11
12
+ DEFAULT_SHOULD_ESCAPE = True
13
+
12
14
def __init__ (self , * args , escape = True , ** kwargs ):
13
15
"""Initializes a new instance of :see:LocalizedBleachField."""
14
16
15
17
self .escape = escape
16
18
17
19
super ().__init__ (* args , ** kwargs )
18
20
21
+ def deconstruct (self ):
22
+ name , path , args , kwargs = super ().deconstruct ()
23
+
24
+ if self .escape != self .DEFAULT_SHOULD_ESCAPE :
25
+ kwargs ["escape" ] = self .escape
26
+
27
+ return name , path , args , kwargs
28
+
19
29
def pre_save (self , instance , add : bool ):
20
30
"""Ran just before the model is saved, allows us to built the slug.
21
31
You can’t perform that action at this time.
0 commit comments