Skip to content

Commit

Permalink
Merge branch 'main' into 2740-translate-group-name-of-public-group
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored Dec 3, 2024
2 parents 8995fa2 + a2d779e commit b586044
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openslides_backend/presenter/check_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def check_meetings(

errors: dict[int, str] = {}
for meeting_id in meeting_ids:
export = export_meeting(datastore, meeting_id)
export = export_meeting(datastore, meeting_id, True)
try:
Checker(
data=export,
Expand Down
6 changes: 2 additions & 4 deletions openslides_backend/shared/export_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ def add_users(
user["is_present_in_meeting_ids"] = [meeting_id]
else:
user["is_present_in_meeting_ids"] = None
if not internal_target:
if not internal_target and (gender_id := user.pop("gender_id", None)):
gender_dict = datastore.get_all("gender", ["name"], lock_result=False)
if user.get("gender_id"):
user["gender"] = gender_dict.get(user["gender_id"], {}).get("name")
del user["gender_id"]
user["gender"] = gender_dict.get(gender_id, {}).get("name")
# limit user fields to exported objects
collection_field_tupels = [
("meeting_user", "meeting_user_ids"),
Expand Down
2 changes: 2 additions & 0 deletions tests/system/presenter/test_check_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def get_new_user(self, username: str, datapart: dict[str, Any]) -> dict[str, Any
}

def test_correct_relations(self) -> None:
"""Also asserts that the internal flag of meeting export is used for the gender"""
self.set_models(
{
"organization/1": {
Expand Down Expand Up @@ -340,6 +341,7 @@ def test_correct_relations(self) -> None:
"is_physical_person": True,
"default_vote_weight": "1.000000",
"organization_id": 1,
"gender_id": 2,
},
"user/2": self.get_new_user(
"present_user",
Expand Down

0 comments on commit b586044

Please sign in to comment.