Commit b82e4274 authored by Wellington Gabriel Vicente de Souza's avatar Wellington Gabriel Vicente de Souza Committed by Odair M.

Resolve "leitura csv não funciona"

parent b6711131
......@@ -36,8 +36,16 @@ class SubmissionCreate(SuccessMessageMixin, CreateView):
def form_valid(self, form):
# muda nomes dos arquivos
form.instance.historico.name = "historico.xls"
form.instance.matricula.name = "matricula.xls"
if ".csv" in form.instance.historico.name:
form.instance.historico.name = "historico.csv"
else:
form.instance.historico.name = "historico.xls"
if ".csv" in form.instance.matricula.name:
form.instance.matricula.name = "matricula.csv"
else:
form.instance.matricula.name = "matricula.xls"
# adiciona a form.instance.usuario e curso
form.instance.author = self.request.user.educator
degree = Degree.objects.get(code=form.instance.degree.code)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment