Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imprint cache not invalidated when language tree nodes are deleted #2625

Closed
timobrembeck opened this issue Jan 29, 2024 · 0 comments · Fixed by #3025
Closed

Imprint cache not invalidated when language tree nodes are deleted #2625

timobrembeck opened this issue Jan 29, 2024 · 0 comments · Fixed by #3025
Assignees
Labels
bug Something isn't working effort: low Should be doable in <4h good first issue Good for newcomers prio: low Not urgent, can be resolved in the distant future.
Milestone

Comments

@timobrembeck
Copy link
Member

Describe the Bug

After deleting language tree nodes, the imprint form still shows the deleted languages in its tabs.

Steps to Reproduce

  1. Enable caching
  2. Go to imprint form to cache the object
  3. Delete language tree node
  4. Return to imprint form and still see the tab of the deleted language

Expected Behavior

The language tabs should not list deleted languages

Actual Behavior

Probably, we have to invalidate the cache of the imprint object here:

def manually_invalidate_models(region: Region) -> None:
"""
This is a helper function to iterate through all affected objects and invalidate their cache.
This is necessary as the original cache invalidation of cacheops only triggers for direct foreign key relationships.
:param region: The affected region
"""
for page in region.pages.all():
invalidate_obj(page)
for event in region.events.all():
invalidate_obj(event)
for poi in region.pois.all():
invalidate_obj(poi)
for push_notification in region.push_notifications.all():
invalidate_obj(push_notification)

@timobrembeck timobrembeck added bug Something isn't working good first issue Good for newcomers prio: low Not urgent, can be resolved in the distant future. effort: low Should be doable in <4h labels Jan 29, 2024
@timobrembeck timobrembeck added this to the 24Q1 milestone Jan 29, 2024
@osmers osmers modified the milestones: 24Q1, 24Q2 Feb 27, 2024
@jarlhengstmengel jarlhengstmengel self-assigned this Apr 9, 2024
@MizukiTemma MizukiTemma modified the milestones: 24Q2, 24Q3 Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort: low Should be doable in <4h good first issue Good for newcomers prio: low Not urgent, can be resolved in the distant future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants