mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 13:06:34 +00:00
Remove debug logging and cache
This commit is contained in:
parent
4a5660be8d
commit
724e632814
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user