Skip to content

Commit

Permalink
Support point of order speakers in re-add-speaker (#1894) (#1905)
Browse files Browse the repository at this point in the history
Co-authored-by: reiterl <ludwig.reiter@intevation.de>
  • Loading branch information
peb-adr and reiterl authored Sep 14, 2023
1 parent 04e9eed commit 56d74f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ def update_instance(self, instance: Dict[str, Any]) -> Dict[str, Any]:
last_speaker_id, last_speaker = speaker_id, speaker
if last_speaker is None:
raise ActionException("There is no last speaker that can be re-added.")
elif last_speaker.get("point_of_order"):
raise ActionException(
"The last speaker is a point of order speaker and cannot be re-added."
)
assert isinstance(lowest_weight, int)

for speaker in speakers.values():
Expand All @@ -87,5 +83,7 @@ def update_instance(self, instance: Dict[str, Any]) -> Dict[str, Any]:
"id": last_speaker_id,
"begin_time": None,
"end_time": None,
"point_of_order": None,
"point_of_order_category_id": None,
"weight": lowest_weight - 1,
}
15 changes: 11 additions & 4 deletions tests/system/action/list_of_speakers/test_re_add_last.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,17 @@ def test_last_speaker_poos(self) -> None:
}
)
response = self.request("list_of_speakers.re_add_last", {"id": 111})
self.assert_status_code(response, 400)
assert (
"The last speaker is a point of order speaker and cannot be re-added."
in response.json["message"]
self.assert_status_code(response, 200)
self.assert_model_exists(
"speaker/223",
{
"list_of_speakers_id": 111,
"meeting_user_id": 42,
"begin_time": None,
"end_time": None,
"point_of_order": None,
"meeting_id": 222,
},
)

def test_last_speaker_also_in_waiting_list(self) -> None:
Expand Down

0 comments on commit 56d74f5

Please sign in to comment.