+
+
+def submit(request):
+ if request.method == 'POST':
+ submit_form = get_submit_form(request.POST)
+ if submit_form.is_valid():
+ submit_form.save()
+ return redirect('migdal_submit_thanks')
+ else:
+ submit_form = get_submit_form()
+
+ return render(request, 'migdal/entry/submit.html', {
+ 'submit_form': submit_form,
+ })
+
+def submit_thanks(request):
+ return render(request, "migdal/entry/submit_thanks.html")
+
+
+class SearchPublishedView(SearchView):
+ def __init__(self, *args, **kwargs):
+ super(SearchPublishedView, self).__init__(*args, **kwargs)
+
+ def get_results(self):
+ results = super(SearchPublishedView, self).get_results()
+ lang_code = get_language()
+ def is_published(entity):
+ if isinstance(entity, Entry):
+ return getattr(entity, "published_%s" % lang_code) == True
+ else:
+ return True
+ results = filter(lambda r: is_published(r.object), results)
+ print results
+ return results