Skip to content
Snippets Groups Projects
Commit 2a092dd7 authored by root's avatar root
Browse files

CSS change for timetable (more padding) | Bug fix for PDF generator of timetable

parent 1494fc8f
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ import subprocess
from django.utils import timezone
from django.utils import formats
from schoolapps.settings import BASE_DIR
# LaTeX constants
TEX_HEADER = """\\documentclass[11pt]{article}
......@@ -94,7 +96,7 @@ def generate_pdf(tex, filename):
"""Generate a PDF by LaTeX code"""
# Read LaTeX file
tex_file = open(os.path.join("latex", filename + ".tex"), "w")
tex_file = open(os.path.join(BASE_DIR, "latex", filename + ".tex"), "w")
tex_file.write(tex)
tex_file.close()
......
......@@ -14,6 +14,7 @@ from untisconnect.sub import get_substitutions_by_date, generate_sub_table
from untisconnect.api import *
from userinformation import UserInformation
from schoolapps.settings import BASE_DIR
def get_all_context():
teachers = get_all_teachers()
......@@ -196,7 +197,7 @@ def sub_pdf(request):
generate_pdf(tex, "class")
# Read and response PDF
file = open(os.path.join("latex", "class.pdf"), "rb")
file = open(os.path.join(BASE_DIR, "latex", "class.pdf"), "rb")
return FileResponse(file, content_type="application/pdf")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment