From 0fb5b34b20f4432ac0ee444507f13a5ba4a35b84 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 15 May 2017 16:51:56 -0300 Subject: [PATCH] Bug fix --- sapl/materia/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index b93d81289..006e2cd88 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -7,7 +7,7 @@ from crispy_forms.layout import HTML from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.contrib.auth.mixins import PermissionRequiredMixin -from django.core.exceptions import ObjectDoesNotExist +from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.http import HttpResponse, JsonResponse @@ -1355,6 +1355,11 @@ class AcompanhamentoMateriaView(CreateView): acompanhar.usuario = usuario.username acompanhar.confirmado = False acompanhar.save() + except MultipleObjectsReturned: + AcompanhamentoMateria.objects.filter( + email=email, + materia=materia, + hash=hash_txt).first() do_envia_email_confirmacao(request, materia, email)