Changes between Version 2 and Version 3 of Ticket #31891
- Timestamp:
- Aug 15, 2020, 1:08:25 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31891 – Description
v2 v3 32 32 }}} 33 33 34 I can fix it by using `a.profile.user = b` which does the cache invalidation as expected. Or using `b.refresh_from_db()`. However I think it makes sense to fix this within the ORM because it's a subtle bug that can cause issues.34 I can fix it by using `a.profile.user = b` instead of `a.profile.user_id = b.id` which does the cache invalidation as expected. Or using `b.refresh_from_db()` after the `save()` call. However I think it makes sense to fix this within the ORM because it's a subtle bug that can cause issues. 35 35 This is a contrived example but the real use-case was cloning a model instance. And instead of erroring it just kept returning the cached value