Skip to content

Commit

Permalink
Check the installed stats app in the django way
Browse files Browse the repository at this point in the history
  • Loading branch information
kimakan committed Oct 9, 2024
1 parent 011faf7 commit e2aaadc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion daiquiri/files/utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit e2aaadc

Please sign in to comment.