Skip to content

Commit

Permalink
Prefer django.conf settings for THUMBNAIL_GENERATOR re #11009
Browse files Browse the repository at this point in the history
Prevents circular import error when executing settings.py as a module.
  • Loading branch information
jacobtylerwalls committed Jul 10, 2024
1 parent f569e09 commit 9d615a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions arches/app/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from arches.app.const import ExtensionType
from arches.app.utils.module_importer import get_class_from_modulename
from arches.app.utils.thumbnail_factory import ThumbnailGeneratorInstance
from arches.app.models.fields.i18n import I18n_TextField, I18n_JSONField
from arches.app.utils import import_class_from_string
from django.contrib.gis.db import models
Expand Down Expand Up @@ -408,8 +409,6 @@ def save(self, *args, **kwargs):
super(File, self).save(*args, **kwargs)

def make_thumbnail(self, kwargs_from_save_call, force=False):
from arches.app.utils.thumbnail_factory import ThumbnailGeneratorInstance

try:
if ThumbnailGeneratorInstance and (force or self.thumbnail_data is None):
self.thumbnail_data = ThumbnailGeneratorInstance.get_thumbnail_data(
Expand Down
2 changes: 1 addition & 1 deletion arches/app/utils/thumbnail_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import logging
import importlib

from arches.app.models.system_settings import settings
from django.conf import settings

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 9d615a2

Please sign in to comment.