Users queryset in clear_permission_cache function could be improved #1648

setsu opened this Issue Mar 7, 2013 · 5 comments


None yet
5 participants

setsu commented Mar 7, 2013

In /cms/cache/ file

def clear_permission_cache():
    users = User.objects.filter(is_active=True)

might be

def clear_permission_cache():
    users = User.objects.filter(is_active=True,

because is quite common to have few administrators and a lot of registered users.

Otherwise, please could you tell me the reason for this logic?


kux commented Mar 8, 2013

It's because of the view permissions which can be applied to regular users as well.

I agree that the query might be quite expensive... An alternative would probably be to have a dedicated permissions only cache which you completely clear (=> no db query at all)


kux commented Mar 8, 2013

You might also want to look at #1423 which is the reason why the query was added.


yakky commented Jul 11, 2013

This should be solved by #1792


henning commented Nov 6, 2013

Ift it's solved, can it be closed? I found this issue by looking for "easy picking" but seems there's nothing that can be done to help here...


digi604 commented Nov 6, 2013

I think we can close it.

@digi604 digi604 closed this Nov 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment