calendar indexOutOfRange bug fixed

remotes/origin/1203
Ivan Kovalkovskyi 11 years ago
parent 0352ea9b9c
commit aa01b8273c
  1. 3
      core/views.py
  2. 5
      templates/client/accounts/calendar.html

@ -265,6 +265,7 @@ from django.core.urlresolvers import reverse
def download_workbook(request): def download_workbook(request):
lang = get_language() lang = get_language()
data = request.GET data = request.GET
if data:
qs = [] qs = []
for i,obj in enumerate(data): for i,obj in enumerate(data):
if data.get('data[%i][name]'%i) == 'expo': if data.get('data[%i][name]'%i) == 'expo':
@ -298,3 +299,5 @@ def download_workbook(request):
response['Content-Disposition'] = 'attachment; filename="My calendar.xls"' response['Content-Disposition'] = 'attachment; filename="My calendar.xls"'
workbook.save(response) workbook.save(response)
return response return response
else:
return HttpResponseRedirect(request.META.get('HTTP_REFERER'), "/profile/calendar/")

@ -65,7 +65,12 @@
} }
console.log(clear_list); console.log(clear_list);
var query = $.param({data:clear_list}); var query = $.param({data:clear_list});
if(clear_list.Length > 0){
window.location.href = "/profile/calendar/export/?" + query; window.location.href = "/profile/calendar/export/?" + query;
}
else{
alert({% trans "Не выбрано ни одного события!" %})
}
}); });
}) })

Loading…
Cancel
Save