Browse Source

Správné hledání lišáka pro obálky

pull/45/head
Pavel "LEdoian" Turinsky 8 months ago
parent
commit
d2926bd1a7
  1. 3
      seminar/views/views_all.py

3
seminar/views/views_all.py

@ -8,6 +8,7 @@ from django.http import Http404
from django.db.models import Q, Sum, Count from django.db.models import Q, Sum, Count
from django.views.generic.base import RedirectView from django.views.generic.base import RedirectView
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.contrib.staticfiles.finders import find
import seminar.models as s import seminar.models as s
import seminar.models as m import seminar.models as m
@ -572,7 +573,7 @@ def obalkyView(request, resitele):
tempdir = tempfile.mkdtemp() tempdir = tempfile.mkdtemp()
with open(tempdir+"/obalky.tex","w") as texfile: with open(tempdir+"/obalky.tex","w") as texfile:
texfile.write(tex.decode()) texfile.write(tex.decode())
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.pdf'), tempdir) shutil.copy(find('seminar/lisak.pdf'), tempdir)
subprocess.call(["pdflatex","obalky.tex"], cwd = tempdir) subprocess.call(["pdflatex","obalky.tex"], cwd = tempdir)
with open(tempdir+"/obalky.pdf","rb") as pdffile: with open(tempdir+"/obalky.pdf","rb") as pdffile:

Loading…
Cancel
Save