Fix exporter

poll ids were used for options
This commit is contained in:
Finn Stutzenstein 2021-07-09 08:18:31 +02:00
parent 19a9eedf17
commit 1c857fb08c
No known key found for this signature in database
GPG Key ID: 9042F605C6324654

View File

@ -280,18 +280,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"):
@ -456,8 +448,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,