Commit cd475b8e authored by Kevin Gutierrez's avatar Kevin Gutierrez
Browse files

Format some html and py files

parent 430f500d
...@@ -131,7 +131,6 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model): ...@@ -131,7 +131,6 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model):
if too_long > len(head) + 1: if too_long > len(head) + 1:
raise SuspiciousFileOperation('File name can not be shortened to a safe length') raise SuspiciousFileOperation('File name can not be shortened to a safe length')
filename = head[:-too_long] + ext filename = head[:-too_long] + ext
file_path = os.path.join(folder_name, filename)
return os.path.join(folder_name, filename) return os.path.join(folder_name, filename)
def get_usage(self): def get_usage(self):
...@@ -143,7 +142,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model): ...@@ -143,7 +142,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model):
@property @property
def formatted_duration(self): def formatted_duration(self):
if(self.duration): if self.duration:
hours, remainder = divmod(self.duration.seconds, 3600) hours, remainder = divmod(self.duration.seconds, 3600)
minutes, seconds = divmod(remainder, 60) minutes, seconds = divmod(remainder, 60)
return "%d:%02d:%02d" % (hours, minutes, seconds) return "%d:%02d:%02d" % (hours, minutes, seconds)
...@@ -327,9 +326,7 @@ class VideoTranscode(AbstractVideoTranscode): ...@@ -327,9 +326,7 @@ class VideoTranscode(AbstractVideoTranscode):
video = models.ForeignKey(Video, related_name='transcodes', on_delete=models.CASCADE) video = models.ForeignKey(Video, related_name='transcodes', on_delete=models.CASCADE)
class Meta: class Meta:
unique_together = ( unique_together = ('video', 'media_format')
('video', 'media_format')
)
class AbstractTrackListing(ClusterableModel): class AbstractTrackListing(ClusterableModel):
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{% include "wagtailadmin/shared/field_as_li.html" with field=field %} {% include "wagtailadmin/shared/field_as_li.html" with field=field %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<li><input class='button' type="submit" value="{% trans 'Save' %}" /></li> <li><input class="button" type="submit" value="{% trans 'Save' %}" /></li>
</ul> </ul>
</form> </form>
</div> </div>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<p>{% trans "Are you sure you want to delete this video?" %}</p> <p>{% trans "Are you sure you want to delete this video?" %}</p>
<form action="{% url 'wagtailvideos:delete' video.id %}" method="POST"> <form action="{% url 'wagtailvideos:delete' video.id %}" method="POST">
{% csrf_token %} {% csrf_token %}
<input type="submit" class='button serious' value="{% trans 'Yes, delete' %}" /> <input type="submit" class="button serious" value="{% trans 'Yes, delete' %}" />
</form> </form>
</div> </div>
</div> </div>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<a class="image-choice" href="{% url 'wagtailvideos:edit' video.id %}"> <a class="image-choice" href="{% url 'wagtailvideos:edit' video.id %}">
<div class="image"> <div class="image">
{% if video.thumbnail %} {% if video.thumbnail %}
<img src='{{video.thumbnail.url}}' height=165 width=165 class="show-transparency" /></img> <img src="{{video.thumbnail.url}}" height="165" width="165" class="show-transparency" alt="{% trans 'Video thumbnail' %}"/>
{% endif %} {% endif %}
</div> </div>
<h3>{{ video.title|ellipsistrim:60 }}</h3> <h3>{{ video.title|ellipsistrim:60 }}</h3>
......
...@@ -12,7 +12,7 @@ def video(parser, token): ...@@ -12,7 +12,7 @@ def video(parser, token):
extra_attrs = {} extra_attrs = {}
# Everyting after video expression # Everyting after video expression
if(len(template_params) > 1): if len(template_params) > 1:
for param in template_params[1:]: for param in template_params[1:]:
try: try:
name, value = param.split('=') name, value = param.split('=')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment