SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 9c9c490d authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Fix: stream signal referenced from instance

parent 902f2c42
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,8 @@ def notify_stream_completed(sender, instance, **kwargs): ...@@ -46,9 +46,8 @@ def notify_stream_completed(sender, instance, **kwargs):
""" """
Notify the production team about a Production Stream being completed. Notify the production team about a Production Stream being completed.
""" """
stream = instance.stream notify.send(sender=sender, recipient=instance.officer.user,
notify.send(sender=sender, recipient=stream.officer.user,
actor=sender, verb=' marked Production Stream as completed.', target=instance) actor=sender, verb=' marked Production Stream as completed.', target=instance)
notify.send(sender=sender, recipient=stream.supervisor.user, notify.send(sender=sender, recipient=instance.supervisor.user,
actor=sender, verb=' marked Production Stream as completed.', target=instance) actor=sender, verb=' marked Production Stream as completed.', target=instance)
...@@ -217,6 +217,7 @@ class DeleteEventView(DeleteView): ...@@ -217,6 +217,7 @@ class DeleteEventView(DeleteView):
@is_production_user() @is_production_user()
@permission_required('scipost.can_publish_accepted_submission', raise_exception=True) @permission_required('scipost.can_publish_accepted_submission', raise_exception=True)
@transaction.atomic
def mark_as_completed(request, stream_id): def mark_as_completed(request, stream_id):
stream = get_object_or_404(ProductionStream.objects.ongoing(), pk=stream_id) stream = get_object_or_404(ProductionStream.objects.ongoing(), pk=stream_id)
stream.status = PRODUCTION_STREAM_COMPLETED stream.status = PRODUCTION_STREAM_COMPLETED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment