Issue6204: Define fields for archiving of meetings

- set initial-data.json to migration_index 1
- md5sum checking for initial-data.json
This commit is contained in:
Ralf Peschke 2021-08-10 18:44:22 +02:00 committed by Finn Stutzenstein
parent 59f6fa1ed3
commit 2b58b2f2f7
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
6 changed files with 208 additions and 164 deletions

View File

@ -0,0 +1,30 @@
---
name: Prevent manual changes of initial-data.json without md5 hash
# The file initial-data.json has a migration-index (MI) set to an active migration,
# In consequence setting up a new system triggers migrations beginning at this MI.
# That's the reason this file is protected against unwanted/unintended edits.
#
# If one is sure to change the initial-data.json file it is allowed!
# 1. Change the file
# 2. Get the md5sum for changed initial-dta.json
# 3. Change the md5-check-literal in this workflow-file
on:
push:
paths:
- "docker/initial-data.json"
pull_request:
paths:
- "docker/initial-data.json"
jobs:
validate-data:
name: Validate example-data.json and initial-data.json
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Show hash for initial-data.json
run: md5sum docker/initial-data.json
- name: Validate and protect initial-data.json
run: echo "79e29bd433253fac11899059d59cebe3 docker/initial-data.json" | md5sum -c -

View File

@ -1,5 +1,5 @@
---
name: Validate models.yml and initial and example data
name: Validate models.yml and example data
on: [push, pull_request]
env:
PYTHON_VERSION: 3.9.6
@ -24,7 +24,7 @@ jobs:
run: python validate.py
validate-data:
name: Validate example-data.json and initial-data.json
name: Validate example-data.json
runs-on: ubuntu-latest
steps:
- name: Check out code
@ -45,7 +45,8 @@ jobs:
run: echo "PYTHONPATH=openslides-backend" >> $GITHUB_ENV
- name: generate models.py for next step
run: python openslides-backend/cli/generate_models.py
run: python openslides-backend/cli/generate_models.py docs/models.yml
- name: Validate example-data.json
run: python openslides-backend/cli/check_json.py docs/example-data.json docker/initial-data.json
run: python openslides-backend/cli/check_json.py docs/example-data.json

View File

@ -1,5 +1,5 @@
{
"_migration_index": -1,
"_migration_index": 1,
"organization": [
{
"id": 1,
@ -11,9 +11,7 @@
"theme": "openslides-default-light-theme",
"reset_password_verbose_errors": false,
"enable_electronic_voting": false,
"committee_ids": [
1
],
"committee_ids": [1],
"resource_ids": [],
"organization_tag_ids": []
}

View File

@ -13,6 +13,8 @@
"reset_password_verbose_errors": true,
"committee_ids": [1],
"active_meeting_ids": [1],
"limit_of_meetings": 20,
"resource_ids": [1],
"organization_tag_ids": [1]
}],
@ -228,6 +230,7 @@
"meeting": [
{
"id": 1,
"is_active_in_organization_id": 1,
"url_name": "os3_test",
"template_for_committee_id": null,
"enable_anonymous": false,

View File

@ -92,16 +92,25 @@ organization:
type: boolean
restriction_mode: B
# Configuration (only for the server owner)
enable_electronic_voting:
type: boolean
restriction_mode: B
limit_of_meetings:
type: number
description: Maximum of active meetings for the whole organization. 0 means no limitation at all
restriction_mode: B
default: 0
minimum: 0
committee_ids:
type: relation-list
restriction_mode: B
to: committee/organization_id
active_meeting_ids:
type: relation-list
restriction_mode: B
to: meeting/is_active_in_organization_id
resource_ids:
type: relation-list
restriction_mode: A
@ -450,6 +459,11 @@ meeting:
maxLength: 100
default: OpenSlides
restriction_mode: A
is_active_in_organization_id:
type: relation
to: organization/active_meeting_ids
restriction_mode: A
description: Backrelation and boolean flag at once
description:
type: string
maxLength: 100
@ -707,7 +721,6 @@ meeting:
default: False
restriction_mode: B
# Motions
motions_default_workflow_id:
type: relation
@ -1326,7 +1339,6 @@ group:
- user.can_see_extra_data
restriction_mode: A
user_ids:
type: relation-list
to: user/group_$_ids

@ -1 +1 @@
Subproject commit c3cef6c3d5066d80fe2ad446dfbb84270def0023
Subproject commit 6218992fe4512b8d00242131de4ce952669ab11a