added delete report SQL call
This commit is contained in:
parent
e315355e81
commit
c0768aaed3
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,6 @@ from rest_framework.decorators import api_view
|
||||||
from django.http import JsonResponse
|
from django.http import JsonResponse
|
||||||
from .models import *
|
from .models import *
|
||||||
from .policy import pol
|
from .policy import pol
|
||||||
import ntpath
|
|
||||||
|
|
||||||
|
|
||||||
# function that prints all the reports
|
# function that prints all the reports
|
||||||
|
@ -134,6 +133,7 @@ def report_detail(request, report_pk):
|
||||||
|
|
||||||
# Delete the report
|
# Delete the report
|
||||||
elif request.method == 'DELETE':
|
elif request.method == 'DELETE':
|
||||||
|
Report.objects.filter(id=report_pk).delete()
|
||||||
return JsonResponse({"message": "Deleted report {0}.".format(report_pk)})
|
return JsonResponse({"message": "Deleted report {0}.".format(report_pk)})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue