Remove debug logging and cache

This commit is contained in:
tcely 2025-02-03 09:22:29 -05:00 committed by GitHub
parent 4a5660be8d
commit 724e632814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,4 @@
from collections import namedtuple
from functools import lru_cache
from typing import Any, Dict
from django import forms
from django.db import connection, models
@ -143,16 +142,10 @@ class CommaSepChoiceField(models.CharField):
# **kwargs,
# })
@lru_cache(maxsize=10)
def from_db_value(self, value, expression, connection):
'''
Create a data structure to be used in Python code.
This is called quite often with the same input,
because the database value doesn't change often.
So, it's being cached to prevent excessive logging.
'''
self.log.debug(f'fdbv:1: {type(value)} {repr(value)}')
if isinstance(value, str) and len(value) > 0:
value = value.split(self.separator)
if not isinstance(value, list):