Skip to content

Commit

Permalink
Fix html.parser error for empty html, add skipped file import (#2442)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-peschke authored May 24, 2024
1 parent dd0429e commit 2c8eb8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openslides_backend/shared/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@


def get_text_from_html(html: str) -> str:
return BeautifulSoup(html, features="html.parser").get_text()
if html:
return BeautifulSoup(html, features="html.parser").get_text()
else:
return ""
9 changes: 9 additions & 0 deletions tests/system/action/meeting/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import time
from typing import Any

import pytest

from openslides_backend.action.action_worker import ActionWorkerState
from openslides_backend.migrations import get_backend_migration_index
from openslides_backend.models.models import Meeting
Expand Down Expand Up @@ -2417,3 +2419,10 @@ def test_without_users(self) -> None:
},
)
self.assert_model_not_exists("user/2")

@pytest.mark.skip()
def test_import_os3_data(self) -> None:
data_raw = get_initial_data_file("global/data/export-OS3-demo.json")
data = {"committee_id": 1, "meeting": data_raw}
response = self.request("meeting.import", data)
self.assert_status_code(response, 200)

0 comments on commit 2c8eb8f

Please sign in to comment.