Opened 2 years ago

Last modified 2 years ago

#33626 closed Cleanup/optimization

django.db.models.query_utils.RegisterLookupMixin._unregister_lookup method also should clear the cache stored for django.db.models.query_utils.RegisterLookupMixin.get_lookups — at Initial Version

Reported by: Himanshu Balasamanta Owned by: Himanshu Balasamanta
Component: Database layer (models, ORM) Version: 4.0
Severity: Normal Keywords: Lookups, caching, ORM
Cc: Carlton Gibson Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In current source code, in the _unregister_lookup method, https://github.com/django/django/blame/main/django/db/models/query_utils.py#L212, the cache is not cleared, which should be done, as it is done in register_lookup, https://github.com/django/django/blame/main/django/db/models/query_utils.py#L202.
Corresponding to this change, minor changes need to be brought in the schema.tests.SchemaTests.test_func_unique_constraint_lookups test.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top