Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support point of order speakers in re-add-speaker (originally #1894) #1905

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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