-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topic json upload rework #1914
Topic json upload rework #1914
Conversation
bfcaaf8
to
3a3d197
Compare
agenda_item = { | ||
field[7:]: value | ||
for field in self.agenda_item_fields | ||
if (value := entry.pop(field, None)) is not None | ||
} | ||
if agenda_item: | ||
agenda_item["id"] = self.topic_lookup.get_field_by_name( | ||
entry["title"], "agenda_item_id" | ||
) | ||
update_agenda_item_payload.append(agenda_item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge this with the code here:
openslides-backend/openslides_backend/action/actions/agenda_item/agenda_creation.py
Line 82 in 95d52ad
def get_dependent_action_data_agenda_item( |
Also, magic numbers (like the 7 here) are almost never a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -195,3 +158,77 @@ def test_json_uplad_permission(self) -> None: | |||
{"data": [{"title": "test"}], "meeting_id": 1}, | |||
Permissions.AgendaItem.CAN_MANAGE, | |||
) | |||
|
|||
|
|||
class TopicJsonUploadForUseInImport(BaseActionTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here as in the account import: Move these to a separate file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment in account import
bb5a57a
to
b82ac49
Compare
b82ac49
to
c9687ad
Compare
…topic and account import
It uses now the general Lookup class with a small modification. The lookup is per meeting.
The JsonUploadMixin handles the type checks.
The topic has a required agenda item. If agenda_* fields are given in the data, this agenda item is updated too. Topic import can only update text, because title is needed for identification.
c9687ad
to
49a817f
Compare
After discussion today it was decided to merge the PR like it is |
Rebased on #1912.
Needs datastore with action_worker route also for collection import_preview now on datastore PR259 Open action_worker route for import_preview