Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MizukiTemma committed Sep 23, 2024
1 parent 59778ba commit 5345776
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions integreat_cms/cms/views/linkcheck/linkcheck_list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> TemplateRespon
params["size"] = size
return redirect(f"{request.path}?{urlencode(params)}")

# pylint: disable-msg=too-many-branches
# pylint: disable-msg=too-many-branches, too-many-locals
def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
r"""
Applies selected action for selected urls
Expand All @@ -154,7 +154,12 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
assert self.instance
new_url = self.form.cleaned_data["url"]
# Get all current contents with the same url
contents = {link.content_object for link in self.instance.region_links}
links = (
self.instance.region_links
if self.request.region
else self.instance.links.all()
)
contents = {link.content_object for link in links}
# Replace the old urls with the new urls in the content
for content in contents:
content.replace_urls(
Expand Down

0 comments on commit 5345776

Please sign in to comment.