Merge pull request #6150 from FinnStutzenstein/fixExporter

Fix exporter
This commit is contained in:
Emanuel Schütze 2021-07-09 08:34:53 +02:00 committed by GitHub
commit 52f35c856d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,18 +286,10 @@ class OS4Exporter:
motion_vote["id"] += self.motion_vote_id_offset motion_vote["id"] += self.motion_vote_id_offset
motion_vote["option_id"] += self.motion_option_id_offset motion_vote["option_id"] += self.motion_option_id_offset
self.poll_id_counter = (
max_or_zero([x["id"] for x in self.get_collection("motions/motion-poll")])
+ 1
)
self.option_id_counter = ( self.option_id_counter = (
max_or_zero([x["id"] for x in self.get_collection("motions/motion-option")]) max_or_zero([x["id"] for x in self.get_collection("motions/motion-option")])
+ 1 + 1
) )
self.vote_id_counter = (
max_or_zero([x["id"] for x in self.get_collection("motions/motion-vote")])
+ 1
)
def migrate_agenda_items(self): def migrate_agenda_items(self):
for old in self.get_collection("agenda/item"): for old in self.get_collection("agenda/item"):
@ -462,8 +454,8 @@ class OS4Exporter:
self.set_model("poll", new) self.set_model("poll", new)
def create_global_option(self, poll): def create_global_option(self, poll):
id = self.poll_id_counter id = self.option_id_counter
self.poll_id_counter += 1 self.option_id_counter += 1
option = { option = {
"id": id, "id": id,
"weight": 1, "weight": 1,