#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 codingjoe):

 I think the `refresh_from_db` documentation is fine. It's the permissions
 cache that could be better documented and maybe even extended.

 It is somewhat unexpected, that you  can `add` or `set`
 `User.user_permissions` but that this will have no effect unless you
 allocate a new instance of `User`.
 Strictly speaking an m2m relationship is called a "field" in Django, or is
 it not? Since the permissions are depended on such a relation, I naturally
 presumed the permissions cache would be covered.

 It would be a good thing to have a public API to clear the permissions
 cache. As a plus it would be great if the cache handles invalidation
 itself.

--
Ticket URL: <https://code.djangoproject.com/ticket/26514#comment:2>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8f2494cb584421fb5173bd3aca774cc8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to