Merge pull request #5084 from fosterseth/fix-4147-schedule500error

Fix 500 error when creating a job schedule

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-10-25 13:35:57 +00:00 committed by GitHub
commit 4a1c121792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,7 +574,7 @@ class SubListCreateAPIView(SubListAPIView, ListCreateAPIView):
status=status.HTTP_400_BAD_REQUEST)
# Verify we have permission to add the object as given.
if not request.user.can_access(self.model, 'add', serializer.initial_data):
if not request.user.can_access(self.model, 'add', serializer.validated_data):
raise PermissionDenied()
# save the object through the serializer, reload and returned the saved