X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/cf1c5c7118e320bdd5b9fa6dcef8585ba117ebb6..69fe4abd2389432ba3f9b017b55d4b8d500c92a0:/src/youtube/views.py diff --git a/src/youtube/views.py b/src/youtube/views.py index cbe1520..4c002ee 100644 --- a/src/youtube/views.py +++ b/src/youtube/views.py @@ -18,9 +18,10 @@ from . import models, tasks @permission_required('archive.change_audiobook') def publish(request, aid, publish=True): audiobook = get_object_or_404(Audiobook, id=aid) - audiobook.youtube_status = status.QUEUED - audiobook.youtube_queued = now() - audiobook.save(update_fields=['youtube_status', 'youtube_queued']) + if audiobook.is_youtube_publishable: + audiobook.youtube_status = status.QUEUED + audiobook.youtube_queued = now() + audiobook.save(update_fields=['youtube_status', 'youtube_queued']) return redirect(reverse('file', args=[aid]))