File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 66from wagtail .utils .widgets import WidgetWithScript
77from wagtail .widget_adapters import WidgetAdapter
88
9- from forecastmanager .constants import WEATHER_CONDITION_CHOICES , WEATHER_CONDITION_ICONS
9+ from forecastmanager .constants import WEATHER_CONDITION_ICONS
1010
1111
1212class WeatherSymbolChooserWidget (WidgetWithScript , widgets .TextInput ):
@@ -22,7 +22,8 @@ def __init__(self, attrs=None):
2222
2323 def get_context (self , name , value , attrs ):
2424 context = super ().get_context (name , value , attrs )
25- context ["widget" ]["icon_url" ] = static ("forecastmanager/weathericons/{0}.png" .format (value ))
25+ if value :
26+ context ["widget" ]["icon_url" ] = static ("forecastmanager/weathericons/{0}.png" .format (value ))
2627 return context
2728
2829 def render_js_init (self , id_ , name , value ):
Original file line number Diff line number Diff line change 11[metadata]
22name = forecastmanager
3- version = 0.4.1
3+ version = 0.4.2
44description = Integration of Weather City Forecasts Manager in Wagtail Projects.
55long_description = file:README.md
66long_description_content_type = text/markdown
You can’t perform that action at this time.
0 commit comments