From: Radek Czajka Date: Mon, 9 Nov 2026 23:17:40 +0000 (+0100) Subject: Don't read from STATIC_ROOT directly X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/4983ea69a6e6c266b0466a851fb4a1ddd27767b4?ds=sidebyside Don't read from STATIC_ROOT directly --- diff --git a/src/club/models.py b/src/club/models.py index 8c6c8db1f..792d6c83e 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -515,7 +515,7 @@ class PayUOrder(payu_models.Order): temp = tempfile.NamedTemporaryFile(prefix='receipt-', suffix='.pdf', delete=False) temp.close() render_to_pdf(temp.name, 'club/receipt.texml', ctx, { - "wl.eps": os.path.join(settings.STATIC_ROOT, "img/wl.eps"), + "wl.eps": os.path.join(settings.PROJECT_DIR, "static/img/wl.eps"), }) with open(temp.name, 'rb') as f: diff --git a/src/opds/views.py b/src/opds/views.py index d2d7b6e09..3862c5cd9 100644 --- a/src/opds/views.py +++ b/src/opds/views.py @@ -77,15 +77,15 @@ class OPDSFeed(Atom1Feed): link_rel = "subsection" link_type = "application/atom+xml" - _book_parent_img = lazy(lambda: full_url(os.path.join(settings.STATIC_URL, "img/book-parent.png")), str)() + _book_parent_img = lazy(lambda: full_url(os.path.join(settings.PROJECT_DIR, "static/img/book-parent.png")), str)() try: - _book_parent_img_size = str(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book-parent.png"))) + _book_parent_img_size = str(os.path.getsize(os.path.join(settings.PROJECT_DIR, "static/img/book-parent.png"))) except OSError: _book_parent_img_size = '' - _book_img = lazy(lambda: full_url(os.path.join(settings.STATIC_URL, "img/book.png")), str)() + _book_img = lazy(lambda: full_url(os.path.join(settings.PROJECT_DIR, "static/img/book.png")), str)() try: - _book_img_size = str(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book.png"))) + _book_img_size = str(os.path.getsize(os.path.join(settings.PROJECT_DIR, "static/img/book.png"))) except OSError: _book_img_size = '' diff --git a/src/reporting/views.py b/src/reporting/views.py index eb647467d..22c0e522b 100644 --- a/src/reporting/views.py +++ b/src/reporting/views.py @@ -79,7 +79,7 @@ def catalogue_pdf(path): 'orphans': orphans, 'books_by_parent': books_by_parent, }, { - "wl-logo.png": os.path.join(settings.STATIC_ROOT, "img/logo-big.png"), + "wl-logo.png": os.path.join(settings.PROJECT_DIR, "static/img/logo-big.png"), })