Changes between Version 2 and Version 3 of Ticket #31891


Ignore:
Timestamp:
Aug 15, 2020, 1:08:25 PM (4 years ago)
Author:
Josh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31891 – Description

    v2 v3  
    3232}}}
    3333
    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.
     34I 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.
    3535This 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
Back to Top