import os
import os.path
import pipes
+import stat
import subprocess
from tempfile import NamedTemporaryFile
from time import sleep
ExistingFile(file_name),
save=False
)
+ os.chmod(getattr(audiobook, field).path, stat.S_IREAD|stat.S_IWRITE|stat.S_IRGRP|stat.S_IROTH)
Audiobook.objects.filter(pk=audiobook.pk).update(
**{field: getattr(audiobook, field)})
self.set_status(aid, status.TAGGING)
self.set_tags(audiobook, out_file.name)
self.set_status(aid, status.SENDING)
- self.save(audiobook, out_file.name)
if publish:
self.put(audiobook, out_file.name)
else:
self.set_status(aid, None)
+ self.save(audiobook, out_file.name)
+
def on_failure(self, exc, task_id, args, kwargs, einfo):
aid = (args[0], kwargs.get('aid'))[0]
self.set_status(aid, None)
--- /dev/null
+{% extends "archive/base.html" %}
+{% block content %}
+<h1>Nie znaleziono strony.</h1>
+
+<p>Nie znaleziono żądanej strony.</p>
+{% endblock %}
--- /dev/null
+Błąd serwera.
{% if user.is_staff %}
<a href='{% url admin:archive_project_changelist %}'>{% trans "Projects" %}</a>
{% endif %}
- <a href="{% url logout %}" style='float: right;'>{% trans "Logout" %}</a>
+ {% if user.is_authenticated %}
+ <a href="{% url logout %}" style='float: right;'>{% trans "Logout" %}</a>
+ {% else %}
+ <a href="{% url login %}" style='float: right;'>{% trans "Login" %}</a>
+ {% endif %}
{% if user.is_staff %}
<a href='{% url admin:index %}' style='float: right;'>{% trans "Administration" %}</a>
{% endif %}
- <span style='float: right;'>{{ user }}</span>
+ {% if user.is_authenticated %}
+ <span style='float: right;'>{{ user }}</span>
+ {% endif %}
<div class='clr' ></div>
{% endblock %}
<p><a href="{% url download audiobook.id 'mp3' %}">{% trans "Download MP3 file." %}</a></p>
{% if audiobook.mp3_published %}
<p>{% trans "Published:" %} {{ audiobook.mp3_published }}</a></p>
- {% tags_table audiobook.mp3_published_tags.tags %}
+ {% if audiobook.mp3_published_tags.tags %}
+ {% tags_table audiobook.mp3_published_tags.tags %}
+ {% endif %}
{% else %}
<p>{% trans "Not published yet." %}</p>
{% endif %}
<p><a href="{% url download audiobook.id 'ogg' %}">{% trans "Download Ogg Vorbis file." %}</a></p>
{% if audiobook.ogg_published %}
<p>{% trans "Published:" %} {{ audiobook.ogg_published }}</a></p>
- {% tags_table audiobook.ogg_published_tags.tags %}
+ {% if audiobook.ogg_published_tags.tags %}
+ {% tags_table audiobook.ogg_published_tags.tags %}
+ {% endif %}
{% else %}
<p>{% trans "Not published yet." %}</p>
{% endif %}
@register.inclusion_tag('archive/tags/tags_table.html')
def tags_table(tags, table=True):
+ if tags is None:
+ tags = {}
return locals()
from archive import settings
from django.contrib.auth import logout
-from django.contrib.auth.decorators import login_required, permission_required
+from django.contrib.auth.decorators import permission_required
from django.core.urlresolvers import reverse
from django.db.models import Q, Max
from django.http import Http404, HttpResponse
from archive.utils import all_files
-@login_required
def list_new(request):
division = 'new'
return response
-@login_required
def list_unpublished(request):
division = 'unpublished'
return render(request, "archive/list_unpublished.html", locals())
-@login_required
def list_publishing(request):
division = 'publishing'
return render(request, "archive/list_publishing.html", locals())
-@login_required
def list_published(request):
division = 'published'
return render(request, "archive/file_managed.html", locals())
-@login_required
def list_unmanaged(request):
division = 'unmanaged'
return render(request, "archive/list_unmanaged.html", locals())
-@login_required
def file_unmanaged(request, filename):
division = 'unmanaged'