1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fix reports API test case

This commit is contained in:
Jeremy Stretch
2020-07-06 11:15:20 -04:00
parent 4ea4112490
commit e02936a44a
2 changed files with 10 additions and 9 deletions

View File

@@ -217,7 +217,7 @@ class ReportViewSet(ViewSet):
"""
# Check that the user has permission to run reports.
if not request.user.has_perm('extras.add_reportresult'):
if not request.user.has_perm('extras.run_script'):
raise PermissionDenied("This user does not have permission to run reports.")
# Retrieve and run the Report. This will create a new JobResult.
@@ -231,7 +231,7 @@ class ReportViewSet(ViewSet):
)
report.result = job_result
serializer = serializers.ReportDetailSerializer(report)
serializer = serializers.ReportDetailSerializer(report, context={'request': request})
return Response(serializer.data)