def get(self, request, incidentId): incident = Incident.objects.get(pk = incidentId) sender = Sender(request) sender.notify(incident) return Response(status = status.HTTP_200_OK)
def get(self, request, *args, **kwargs): incident_id = kwargs.get('incident') incident = Incident.objects.get(pk = incident_id) sender = Sender(request) sender.notify(incident) return redirect('incident-details', pk=kwargs.get('incident'), permanent=False)