#26514: User.refresh_from_db() does not clear Permission cache.
------------------------------+--------------------------------------
     Reporter:  codingjoe     |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  contrib.auth  |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  1             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by timgraham):

 The `ModelBackend` cache
 [https://docs.djangoproject.com/en/stable/topics/auth/default/#permission-
 caching is documented]. I suppose it wouldn't hurt to add a sentence there
 like "`refresh_from_db()` won't clear this cache."

 The value of `user_permissions` isn't actually cached. The cache is stored
 in a private attribute `user._per_cache`. I'm weary of heading down the
 road of adding custom `refresh_from_db()` methods to all models that have
 similar behavior.

--
Ticket URL: <https://code.djangoproject.com/ticket/26514#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6d2e9d0a2a3a063a63c3c0b07cc5ec00%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to