def clear_dropdown_cache(cls, domain, user_id): for is_active in True, False: key = make_template_fragment_key('header_tab', [ cls.class_name(), domain, is_active, user_id, get_language(), ]) cache.delete(key)
def clear_app_cache(request, domain): ApplicationBase.get_db().view('app_manager/applications_brief', startkey=[domain], limit=1, ).all() for is_active in True, False: key = make_template_fragment_key('header_tab', [ domain, None, # tab.org should be None for any non org page ApplicationsTab.view, is_active, request.couch_user.get_id, get_language(), ]) cache.delete(key)
def clear_dropdown_cache(cls, domain, user): user_id = user.get_id try: user_role = user.get_role(domain, allow_mirroring=True) role_rev = user_role._rev if user_role else None except DomainMembershipError: role_rev = None for is_active in True, False: key = make_template_fragment_key('header_tab', [ cls.class_name(), domain, is_active, user_id, role_rev, get_language(), ]) cache.delete(key)