File tree 1 file changed +8
-1
lines changed
apps/html_template_editor
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 5
5
# from django.contrib.auth import get_user_model
6
6
from django .contrib .postgres .fields import JSONField
7
7
from django .db import models
8
+ from django .utils .functional import lazy
8
9
from django .utils .html import mark_safe
9
10
from django .utils .translation import ugettext_lazy as _
10
11
@@ -166,7 +167,7 @@ class Meta:
166
167
167
168
icon_name = models .CharField (
168
169
verbose_name = _ ("Icon name" ),
169
- choices = get_social_media_icons_names (),
170
+ choices = (),
170
171
max_length = 20 ,
171
172
null = True ,
172
173
blank = True ,
@@ -177,6 +178,12 @@ class Meta:
177
178
blank = True ,
178
179
)
179
180
181
+ def __init__ (self , * args , ** kwargs ):
182
+ super ().__init__ (* args , ** kwargs )
183
+ self ._meta .get_field ('icon_name' ).choices = lazy (
184
+ get_social_media_icons_names ,
185
+ )()
186
+
180
187
def __str__ (self ):
181
188
return f'{ self .icon_name } : { self .url } '
182
189
You can’t perform that action at this time.
0 commit comments