diff --git a/client/src/app/core/core-services/http.service.ts b/client/src/app/core/core-services/http.service.ts index 8ae0f375d..7e10cbcbd 100644 --- a/client/src/app/core/core-services/http.service.ts +++ b/client/src/app/core/core-services/http.service.ts @@ -159,9 +159,13 @@ export class HttpService { } else { const errorList = Object.keys(e.error).map(key => { const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1); - return `${this.translate.instant(capitalizedKey)}: ${this.processErrorDetailResponse( - e.error[key] - )}`; + let detail = e.error[key]; + if (detail instanceof Array) { + detail = detail.join(' '); + } else { + detail = this.processErrorDetailResponse(detail); + } + return `${this.translate.instant(capitalizedKey)}: ${detail}`; }); error = errorList.join(', '); } diff --git a/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts b/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts index 6c216b2b1..8552bfa91 100644 --- a/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts +++ b/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts @@ -346,7 +346,7 @@ export class AssignmentDetailComponent extends BaseViewComponentDirective implem ...this.assignmentPollService.getDefaultPollData(this.assignment.id) }; - this.pollDialog.openDialog(dialogData); + this.pollDialog.openDialog(dialogData).catch(this.raiseError); } /** diff --git a/server/openslides/core/config.py b/server/openslides/core/config.py index 9b86a34ab..dff3bea31 100644 --- a/server/openslides/core/config.py +++ b/server/openslides/core/config.py @@ -256,6 +256,16 @@ class ConfigHandler: """ return ConfigStore.get_collection_string() + def remove_group_id_from_all_group_configs(self, id: int) -> None: + for config_variable in self.config_variables.values(): + if config_variable.input_type == "groups": + value = self[config_variable.name] + if isinstance(value, list) and id in value: + value = [x for x in value if x != id] + db_value = ConfigStore.objects.get(key=config_variable.name) + db_value.value = value + db_value.save() + config = ConfigHandler() """ diff --git a/server/openslides/users/views.py b/server/openslides/users/views.py index 5890f9e0d..1bcad2415 100644 --- a/server/openslides/users/views.py +++ b/server/openslides/users/views.py @@ -657,6 +657,7 @@ class GroupViewSet(ModelViewSet): # Delete the group self.perform_destroy(instance) + config.remove_group_id_from_all_group_configs(instance.id) # Get the updated user data from the DB. affected_users = User.objects.filter(pk__in=affected_users_ids)