Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyStk committed Aug 7, 2024
1 parent 8a32685 commit c7c35af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integreat_cms/cms/fixtures/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5786,7 +5786,7 @@
"fields": {
"title": "Integrationsbeauftragte",
"name": "Martina Musterfrau",
"poi": 4,
"poi": 6,
"email": "[email protected]",
"phone_number": "0123456789",
"website": "",
Expand All @@ -5801,7 +5801,7 @@
"fields": {
"title": "Integrationsberaterin",
"name": "Martina Musterfrau",
"poi": 5,
"poi": 6,
"email": "[email protected]",
"phone_number": "0987654321",
"website": "www.random-page.com",
Expand Down
6 changes: 4 additions & 2 deletions integreat_cms/cms/views/regions/region_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from linkcheck.listeners import disable_listeners

from ...decorators import permission_required
from ...models import Page, PushNotification, Region
from ...models import Contact, Page, PushNotification, Region

if TYPE_CHECKING:
from typing import Any
Expand Down Expand Up @@ -51,7 +51,7 @@ def delete_region(
messages.error(
request,
format_html(
"{}<ul class='list-disc pl-4'>{}</ul>",
"{}<ul class='pl-4 list-disc'>{}</ul>",
_(
"Region could not be deleted, because the following pages are mirrored in other regions:"
),
Expand Down Expand Up @@ -96,6 +96,8 @@ def delete_region(
region.events.update(location=None)
# Prevent ProtectedError when media files get deleted before their usages as organization logo
region.organizations.all().delete()
# Prevent ProtectedError when location gets deleted before their contacts
Contact.objects.filter(poi__region=region).delete()
# Prevent IntegrityError when multiple feedback objects exist
region.feedback.all().delete()
# Disable linkchecking while deleting this region
Expand Down

0 comments on commit c7c35af

Please sign in to comment.