Skip to content

Commit

Permalink
apps/organisation: add migration for ckeditor iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk committed Mar 25, 2024
1 parent 04b6b61 commit add30d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/organisations/migrations/0022_ckeditor_iframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from bs4 import BeautifulSoup
from django.db import migrations
from django.utils import translation


def replace_iframe_with_figur(apps, schema_editor):
Expand All @@ -10,6 +11,8 @@ def replace_iframe_with_figur(apps, schema_editor):
'{url}"></iframe></div></div></figure>'
)
Organisation = apps.get_model("a4_candy_organisations", "Organisation")
translation.activate("en")

for organisation in Organisation.objects.all():
soup = BeautifulSoup(organisation.description, "html.parser")
iframes = soup.findAll("iframe")
Expand Down

0 comments on commit add30d7

Please sign in to comment.