Skip to content

Commit

Permalink
Enhance creation of default settings
Browse files Browse the repository at this point in the history
- Remove cache requirement
- Replaces #9021
  • Loading branch information
SchrodingersGat committed Feb 4, 2025
1 parent b6c7a63 commit fbb2713
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/backend/InvenTree/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,6 @@ def build_default_values(cls, **kwargs):
If a particular setting is not present, create it with the default value
"""
cache_key = f'BUILD_DEFAULT_VALUES:{cls.__name__!s}'

try:
if InvenTree.helpers.str2bool(cache.get(cache_key, False)):
# Already built default values
return
except Exception:
pass

try:
existing_keys = cls.objects.filter(**kwargs).values_list('key', flat=True)
settings_keys = cls.SETTINGS.keys()
Expand All @@ -198,11 +189,6 @@ def build_default_values(cls, **kwargs):
'Failed to build default values for %s (%s)', str(cls), str(type(exc))
)

try:
cache.set(cache_key, True, timeout=3600)
except Exception:
pass

def _call_settings_function(self, reference: str, args, kwargs):
"""Call a function associated with a particular setting.
Expand Down

0 comments on commit fbb2713

Please sign in to comment.