From e2aaadc52269df8270c79c9bbff666d0f964b956 Mon Sep 17 00:00:00 2001 From: kimakan <45099849+kimakan@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:06:50 +0200 Subject: [PATCH] Check the installed stats app in the django way --- daiquiri/files/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daiquiri/files/utils.py b/daiquiri/files/utils.py index 38962031..e348f6a2 100644 --- a/daiquiri/files/utils.py +++ b/daiquiri/files/utils.py @@ -1,6 +1,7 @@ import os import logging +from django.apps import apps from django.conf import settings from django.shortcuts import render from django.utils.encoding import force_str @@ -88,7 +89,7 @@ def send_file(request, file_path, search=None): absolute_file_path = os.path.join(settings.FILES_BASE_PATH, file_path) - if 'daiquiri.stats' in settings.INSTALLED_APPS: + if apps.is_installed('daiquiri.stats'): from daiquiri.stats.models import Record Record.objects.create( time=now(),