Skip to content

Commit

Permalink
Make changes
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom committed Jul 10, 2024
1 parent 9fb1c81 commit 6ab8a06
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 46 deletions.
7 changes: 6 additions & 1 deletion openslides_backend/action/actions/motion/create_forwarded.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ def check_permissions(self, instance: dict[str, Any]) -> None:
def create_amendments(self, amendment_data: ActionData) -> ActionResults | None:
return self.execute_other_action(MotionCreateForwardedAmendment, amendment_data)

def update_instance(self, instance: dict[str, Any]) -> dict[str, Any]:
self.with_amendments = instance.pop("with_amendments", False)
super().update_instance(instance)
return instance

def should_forward_amendments(self, instance: dict[str, Any]) -> bool:
return instance.pop("with_amendments", False)
return self.with_amendments
1 change: 0 additions & 1 deletion openslides_backend/action/actions/user/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class UserCreate(
"is_present_in_meeting_ids",
"committee_management_ids",
"is_demo_user",
# "forwarding_committee_ids",
"saml_id",
"member_number",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ def check_permissions(self, instance: dict[str, Any]) -> None:
"""
self.assert_not_anonymous()

# if "forwarding_committee_ids" in instance:
# raise PermissionDenied("forwarding_committee_ids is not allowed.")

if not hasattr(self, "permstore"):
self.permstore = PermissionVarStore(
self.datastore, self.user_id, self.permission
Expand Down
29 changes: 0 additions & 29 deletions tests/system/action/meeting/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,35 +823,6 @@ def test_check_usernames_new_and_twice(self) -> None:
)
self.assert_model_not_exists("user/3")

# def test_with_forwarding_committees(self) -> None:
# request_data = self.create_request_data(
# {
# "user": {
# "2": self.get_user_data(
# 2,
# {
# "username": "user2",
# "last_name": "new user",
# "email": "[email protected]",
# "forwarding_committee_ids": [4],
# },
# )
# }
# }
# )

# response = self.request("meeting.import", request_data)
# self.assert_status_code(response, 200)
# user2 = self.assert_model_exists(
# "user/3",
# {
# "username": "user2",
# "last_name": "new user",
# "email": "[email protected]",
# },
# )
# assert not user2.get("forwarding_committee_ids")

def test_check_negative_default_vote_weight(self) -> None:
request_data = self.create_request_data({})
request_data["meeting"]["user"]["1"] = self.get_user_data(
Expand Down
12 changes: 0 additions & 12 deletions tests/system/action/user/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,18 +1217,6 @@ def test_create_default_vote_weight_none(self) -> None:
user = self.get_model("user/2")
assert "default_vote_weight" not in user

# def test_create_forwarding_committee_ids_not_allowed(self) -> None:
# self.set_models({"meeting/1": {"is_active_in_organization_id": 1}})
# response = self.request(
# "user.create",
# {
# "username": "test_Xcdfgee",
# "forwarding_committee_ids": [],
# },
# )
# self.assert_status_code(response, 403)
# assert "forwarding_committee_ids is not allowed." in response.json["message"]

def test_create_negative_vote_weight(self) -> None:
self.set_models(
{
Expand Down

0 comments on commit 6ab8a06

Please sign in to comment.