Skip to content

Commit

Permalink
Spelling, deletion of unnecessary code and one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom committed Dec 3, 2024
1 parent 30fd0f8 commit 5bc8da3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/actions/motion.create.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This is the logic for other fields depending on the motion type:
There are some fields that need special attention:
- `workflow_id`: If it is given, the motion's state is set to the workflow's first state. The workflow must be from the same meeting. If the field is not given, one of the three default (`meeting/motions_default_workflow_id` or `meeting/motions_default_amendment_workflow_id`) workflows is used depending on the type of the motion to create.
- `additional_submitter` a text field where text-based submitter information may be entered. Cannot be set unless `meeting/motions_create_enable_additional_submitter_text` is `true`.
- `submitter_ids`: These are **user ids** and not ids of the `submitter` model. If nothing is given (`[]`) adn the field `additional_submitter` isn't filled, the request user's id is used. For each id in the list a `motion_submitter` model is created. The weight must be set to the order of the given list.
- `submitter_ids`: These are **user ids** and not ids of the `submitter` model. If nothing is given (`[]`) and the field `additional_submitter` isn't filled, the request user's id is used. For each id in the list a `motion_submitter` model is created. The weight must be set to the order of the given list.
- `agenda_*`: See [Agenda](https://github.com/OpenSlides/OpenSlides/wiki/Agenda#additional-fields-during-creation-of-agenda-content-objects).

Other things to do when creating motions:
Expand Down
32 changes: 26 additions & 6 deletions tests/system/action/motion/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,41 @@ def test_create_simple_fields(self) -> None:
)
self.assert_status_code(response, 200)
motion = self.assert_model_exists(
"motion/2", {**motion, "attachment_meeting_mediafile_ids": [80]}
"motion/2",
{
**motion,
"attachment_meeting_mediafile_ids": [80],
"additional_submitter": "test",
},
)
assert motion.get("submitter_ids") is None

def test_create_additional_submitter_forbidden(self) -> None:
def test_create_normal_and_additional_submitter(self) -> None:
self.set_models(
{
"motion/1": {
"title": "title_eJveLQIh",
"meeting_id": 1,
"meeting/1": {
"motions_create_enable_additional_submitter_text": True,
},
"meeting/1": {"mediafile_ids": [8], "meeting_mediafile_ids": [80]},
}
)
bob_id = self.create_user("bob", [3])
response = self.request(
"motion.create",
{
"title": "test_Xcdfgee",
"meeting_id": 1,
"text": "test",
"reason": "test",
"additional_submitter": "test",
"submitter_ids": [bob_id],
},
)
self.assert_status_code(response, 200)
self.assert_model_exists(
"motion/1", {"additional_submitter": "test", "submitter_ids": [bob_id - 1]}
)

def test_create_additional_submitter_forbidden(self) -> None:
response = self.request(
"motion.create",
{
Expand Down

0 comments on commit 5bc8da3

Please sign in to comment.