Fixed possibility to set ical feed to none.

This commit is contained in:
Martin Edenhofer 2015-09-25 11:48:14 +02:00
parent 8719c4350e
commit 0c7be7c346
2 changed files with 5 additions and 2 deletions

View file

@ -9,7 +9,7 @@
</label>
<div class="u-inlineBlock u-positionOrigin">
<select class="form-control form-control--small js-list">
<option>-</option>
<option value="">-</option>
<% for url, name of @ical_feeds: %>
<option value="<%= url %>" <% if @attribute.value is url: %>selected<%end%>><%- @T(name) %></option>
<% end %>

View file

@ -209,7 +209,10 @@ returns
def sync(without_save = nil)
return if !ical_url
begin
events = Calendar.parse(ical_url)
events = {}
if ical_url && !ical_url.empty?
events = Calendar.parse(ical_url)
end
# sync with public_holidays
if !public_holidays