Commit def70ab5 authored by Ale's avatar Ale

feat: Update notifications

parent 30ac6860
......@@ -8,6 +8,7 @@ from django.core.mail import send_mail
from apps.map import models
from .serializers import TestimonySerializer
from apps.map.forms import TestimonyForm
from django.urls import reverse
class TestimonyViewSet(viewsets.ModelViewSet):
queryset = models.Testimony.objects.filter(published=True).order_by('-creation_date')
......@@ -34,9 +35,11 @@ def create_testimony(request):
)
send_mail(
'Hay un nuevo testimonio en Patio108',
'',
'Puedes verlo en: %s \n¡Hasta luego, m\'arma!' % request.build_absolute_uri(
reverse('admin:map_testimony_change', args=(new_testimony.pk,))
),
'no-reply@patio108.es',
['contacta@patio108.es'],
['contacto@patio108.es'],
fail_silently=False,
)
messages.success(request, "Gracias por tu testimonio, se publicará en cuanto lo revisemos!")
......
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