for line in form_data
])
else:
reader = csv.reader(form_data)
Document.objects.bulk_create([
Document(text=line[0].strip(), project=project)
for line in reader
])
After Change
except Exception as e:
logger.exception(e)
messages.add_message(request, messages.ERROR, "Something went wrong")
return HttpResponseRedirect(reverse("upload", args=[project.id]))
class DataDownload(SuperUserMixin, LoginRequiredMixin, TemplateView):
template_name = "admin/dataset_download.html"