Browse Source

Generování stvrzenek nedostávalo TeXovský soubor do tempu.

pull/3/head
Jonas Havelka 2 years ago
parent
commit
6ca79ac342
  1. 3
      soustredeni/views.py

3
soustredeni/views.py

@ -66,8 +66,9 @@ def soustredeniStvrzenkyView(request, soustredeni):
static = Path(settings.STATIC_ROOT) static = Path(settings.STATIC_ROOT)
tempdir = Path(tempfile.mkdtemp()) tempdir = Path(tempfile.mkdtemp())
shutil.copy(static / 'images/logomm.pdf', tempdir) shutil.copy(static / 'images/logomm.pdf', tempdir)
shutil.copy(static / 'seminar/stvrzenky.tex', tempdir)
subprocess.run( subprocess.run(
['pdfcsplain', static / 'seminar/stvrzenky.tex'], ['pdfcsplain', 'stvrzenky.tex'],
cwd=tempdir, cwd=tempdir,
encoding='utf-8', encoding='utf-8',
input=f'{soustredeni.datum_zacatku.strftime("%-d.~%-m.~%Y")} -- {soustredeni.datum_konce.strftime("%-d.~%-m.~%Y")}\n{soustredeni.misto}\n' input=f'{soustredeni.datum_zacatku.strftime("%-d.~%-m.~%Y")} -- {soustredeni.datum_konce.strftime("%-d.~%-m.~%Y")}\n{soustredeni.misto}\n'

Loading…
Cancel
Save