Skip to content

Commit

Permalink
Merge pull request #1778 from digitalfabrik/bugfix/deleting-regions-n…
Browse files Browse the repository at this point in the history
…ot-possible-if-media-library-has-nested-structure

Fix region deletion error if media library has nested structure
  • Loading branch information
seluianova committed Oct 24, 2022
2 parents f4aacbd + 5237de6 commit f90e5aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ UNRELEASED

* [ [#1350](https://github.com/digitalfabrik/integreat-cms/issues/1350) ] Various small PDF export improvements
* [ [#1777](https://github.com/digitalfabrik/integreat-cms/issues/1777) ] Fix autocompleting POI address for non-staff users
* [ [#1749](https://github.com/digitalfabrik/integreat-cms/issues/1749) ] Fix region deletion error if media library has nested structure


2022.10.1
Expand Down
2 changes: 2 additions & 0 deletions integreat_cms/cms/views/regions/region_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def delete_region(request, *args, **kwargs):
# Remove hierarchy to prevent ProtectedError when children get deleted before their parents
region.pages.update(parent=None)
region.language_tree_nodes.update(parent=None)
region.media_directories.update(parent=None)
region.files.update(parent_directory=None)
# Prevent ProtectedError when location gets deleted before their events
region.events.update(location=None)
# Delete region and cascade delete all contents
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7453,7 +7453,7 @@ msgstr ""
"Bitte erstellen Sie mindestens einen Sprach-Knoten, bevor Sie Push-"
"Benachrichtigungen verwalten."

#: cms/views/regions/region_actions.py:65
#: cms/views/regions/region_actions.py:67
msgid "Region was successfully deleted"
msgstr "Region wurde erfolgreich gelöscht"

Expand Down

0 comments on commit f90e5aa

Please sign in to comment.