Skip to content

Commit

Permalink
Portlet improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosfromero committed Oct 31, 2013
1 parent d89c3e3 commit 77ca50d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/collective/weather/portlets/weather.pt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<dl class="portlet portletWeather"
i18n:domain="collective.weather"
tal:define="portal context/@@plone_portal_state/portal">
tal:define="portal context/@@plone_portal_state/portal;
current_city view/current_city|nothing"
tal:condition="current_city">

<dt class="portletHeader">
<span tal:content="view/data/header">Weather</span>
</dt>

<dd i18n:domain="collective.weather"
tal:define="current_city view/current_city|nothing"
tal:condition="current_city">

<span tal:define="city_name current_city/name|nothing"
Expand Down
4 changes: 1 addition & 3 deletions src/collective/weather/portlets/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ def update(self):
self.current_city = {'id': location.value, 'name': location.title}

self.weather_info = None
try:
if not self.current_city is None:
weather_utility.update_weather_info(self.current_city['id'])
self.weather_info = weather_utility.get_weather_info(self.current_city)
except:
pass


class AddForm(base.AddForm):
Expand Down

0 comments on commit 77ca50d

Please sign in to comment.