mirror of
https://github.com/django/django.git
synced 2025-10-04 07:46:37 +00:00
Fixed #24590 -- Cached calls to swappable_setting.
Moved the lookup in Field.swappable_setting to Apps, and added an lru_cache to cache the results. Refs #24743 Thanks Marten Kenbeek for the initial work on the patch. Thanks Aymeric Augustin and Tim Graham for the review.
This commit is contained in:
parent
91f701f4fc
commit
e1427cc609
5 changed files with 56 additions and 29 deletions
|
@ -396,7 +396,7 @@ class Options(object):
|
|||
# or as part of validation.
|
||||
return swapped_for
|
||||
|
||||
if '%s.%s' % (swapped_label, swapped_object.lower()) not in (None, self.label_lower):
|
||||
if '%s.%s' % (swapped_label, swapped_object.lower()) != self.label_lower:
|
||||
return swapped_for
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue