From 75bd3c50e5cab93ee4ea22b89fa62aa7a3fd3a76 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Thu, 29 Apr 2021 07:53:02 +0200 Subject: [PATCH] Fix LOS (closes #6035) --- .../list-of-speakers-content.component.html | 2 +- .../list-of-speakers-content.component.ts | 4 ---- server/openslides/agenda/views.py | 11 +++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.html b/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.html index b4490f374..f37ecd613 100644 --- a/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.html +++ b/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.html @@ -141,7 +141,7 @@ *ngIf="speaker.point_of_order" >warning - + {{ speaker.note }} diff --git a/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.ts b/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.ts index 8842f9fc0..09b89d9c4 100644 --- a/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.ts +++ b/client/src/app/shared/components/list-of-speakers-content/list-of-speakers-content.component.ts @@ -87,10 +87,6 @@ export class ListOfSpeakersContentComponent extends BaseViewComponentDirective i return !this.config.instant('agenda_present_speakers_only') || this.operator.user.is_present; } - public get showSpeakersOrderNote(): boolean { - return this.noteForAll || this.opCanManage; - } - @Input() public set speakers(los: ViewListOfSpeakers) { this.setListOfSpeakers(los); diff --git a/server/openslides/agenda/views.py b/server/openslides/agenda/views.py index 72516b17f..00cbd9fde 100644 --- a/server/openslides/agenda/views.py +++ b/server/openslides/agenda/views.py @@ -574,6 +574,11 @@ class SpeakerViewSet(UpdateModelMixin, GenericViewSet): ): raise ValidationError({"detail": "pro/contra speech is not enabled"}) + if "pro_speech" in request.data and "marked" in request.data: + raise ValidationError( + {"detail": "pro_speech and marked cannot be given together"} + ) + if not has_perm(request.user, "agenda.can_manage_list_of_speakers"): # if no manage perms, only the speaker user itself can update the speaker. speaker = self.get_object() @@ -590,4 +595,10 @@ class SpeakerViewSet(UpdateModelMixin, GenericViewSet): {"detail": f"You are not allowed to set {key}"} ) + # toggle marked/pro_speech: If one is given, reset the other one + if request.data.get("pro_speech") in (True, False): + request.data["marked"] = False + if request.data.get("marked"): + request.data["pro_speech"] = None + return super().update(request, *args, **kwargs)