Skip to content

Commit

Permalink
Add pydoc on receivers and end line on loader.html
Browse files Browse the repository at this point in the history
  • Loading branch information
pampletousse committed Dec 4, 2023
1 parent 98104c8 commit 9216179
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pod/main/templates/loader.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n %}
<div id="{{ loaderid|default:"loader" }}" class="d-flex justify-content-center align-items-center d-none loaderSpinner">
<div id="{{ loaderid|default:'loader' }}" class="d-flex justify-content-center align-items-center d-none loaderSpinner">
<div class="spinner-border" role="status">
<span class="visually-hidden">{% trans 'Loading…' %}</span>
</div>
</div>
</div>
14 changes: 14 additions & 0 deletions pod/video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ def __call__(self, value):

@receiver(post_save, sender=Video)
def launch_encode(sender, instance, created, **kwargs):
"""
Launch encoding after save Video if requested.
Args:
sender (::class::`pod.video.models.Video`): Video model class.
instance (Video): video object instance.
"""
if hasattr(instance, "launch_encode") and instance.launch_encode is True:
instance.launch_encode = False
encode_video = getattr(encode, ENCODE_VIDEO)
Expand All @@ -546,6 +553,13 @@ def launch_encode(sender, instance, created, **kwargs):

@receiver(post_save, sender=Video)
def launch_transcript(sender, instance, created, **kwargs):
"""
Launch transcription after save Video if requested.
Args:
sender (::class::`pod.video.models.Video`): Video model class.
instance (Video): video object instance.
"""
if hasattr(instance, "launch_transcript") and instance.launch_transcript is True:
instance.launch_transcript = False
transcript_video = getattr(transcript, TRANSCRIPT_VIDEO)
Expand Down

0 comments on commit 9216179

Please sign in to comment.