OpenSlides / OpenSlides/openslides-backend
Check changed data in participant import preview entries
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 40
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
Describe the enhacement
A referenced participant on import can also have his data updated. To avoid unwanted overwritings it's important to show that the imported data is different than the current participant's data. For that, a different state for entries is needed.
How To Reproduce
- Create participant in Meeting_1
- Create Meeting_2
- Change to Meeting_2
- Import CSV file with any of that participant's data changed
- Participant is referenced but the updated data in the cell is not shown as updated
Payload from client (handle_request)
[{"action":"participant.json_upload","data":[{"data":[{"first_name":"Max","last_name":"Musterhuman","email":"maxi@example.com","member_number":"12345678","structure_level":"Berlin","groups":"Delegates, Staff","number":"D001","vote_weight":"1","gender":"diverse","pronoun":"they","default_password":"333","is_active":"1","is_physical_person":"1","comment":"asdsadsa"},{"first_name":"Jo","last_name":"Nesbø","email":"jonesbo@email.com"},{"first_name":"Bjørnstjerne","last_name":"Bjørnson","email":"bojostene@email.com"}],"meeting_id":2}]}]
Response from backend
{"status_code": 200, "success": true, "message": "Actions handled successfully", "results": [[{"id": 2049, "headers": [{"property": "title", "type": "string", "is_object": true}, {"property": "first_name", "type": "string", "is_object": true}, {"property": "last_name", "type": "string", "is_object": true}, {"property": "is_active", "type": "boolean", "is_object": true}, {"property": "is_physical_person", "type": "boolean", "is_object": true}, {"property": "default_password", "type": "string", "is_object": true}, {"property": "email", "type": "string", "is_object": true}, {"property": "username", "type": "string", "is_object": true}, {"property": "gender", "type": "string", "is_object": true}, {"property": "pronoun", "type": "string", "is_object": true}, {"property": "saml_id", "type": "string", "is_object": true}, {"property": "member_number", "type": "string", "is_object": true}, {"property": "home_committee", "type": "string", "is_object": true}, {"property": "external", "type": "boolean", "is_object": true}, {"property": "structure_level", "type": "string", "is_object": true, "is_list": true}, {"property": "number", "type": "string", "is_object": true}, {"property": "vote_weight", "type": "decimal", "is_object": true}, {"property": "comment", "type": "string", "is_object": true}, {"property": "is_present", "type": "boolean", "is_object": true}, {"property": "groups", "type": "string", "is_object": true, "is_list": true}, {"property": "locked_out", "type": "boolean", "is_object": true}], "rows": [{"state": "done", "messages": [], "data": {"first_name": {"value": "Max", "info": "done"}, "last_name": {"value": "Musterhuman", "info": "done"}, "email": {"info": "done", "value": "maxi@example.com"}, "member_number": {"value": "12345678", "info": "done", "id": 25}, "number": {"value": "D001", "info": "done"}, "vote_weight": {"value": "1.000000", "info": "done"}, "pronoun": {"value": "they", "info": "done"}, "default_password": {"value": "333", "info": "done"}, "is_active": {"value": true, "info": "done"}, "is_physical_person": {"value": true, "info": "done"}, "comment": {"value": "asdsadsa", "info": "done"}, "id": 25, "username": {"value": "MaxMusterhuman", "info": "done"}, "gender": {"info": "done", "value": "diverse", "id": 3}, "groups": [{"value": "Delegates", "info": "done", "id": 9}, {"value": "Staff", "info": "done", "id": 10}], "structure_level": [{"value": "Berlin", "info": "new"}]}}, {"state": "new", "messages": [], "data": {"first_name": {"value": "Jo", "info": "done"}, "last_name": {"value": "Nesb\u00f8", "info": "done"}, "email": {"info": "done", "value": "jonesbo@email.com"}, "username": {"value": "JoNesb\u00f8", "info": "generated"}, "default_password": {"value": "3PX7Zpda4A", "info": "generated"}, "groups": [{"value": "Default", "info": "generated", "id": 7}]}}, {"state": "new", "messages": [], "data": {"first_name": {"value": "Bj\u00f8rnstjerne", "info": "done"}, "last_name": {"value": "Bj\u00f8rnson", "info": "done"}, "email": {"info": "done", "value": "bojostene@email.com"}, "username": {"value": "Bj\u00f8rnstjerneBj\u00f8rnson", "info": "generated"}, "default_password": {"value": "hjFDDZxXsi", "info": "generated"}, "groups": [{"value": "Default", "info": "generated", "id": 7}]}}], "statistics": [{"name": "total", "value": 3}, {"name": "created", "value": 2}, {"name": "updated", "value": 1}, {"name": "error", "value": 0}, {"name": "warning", "value": 0}, {"name": "structure levels created", "value": 1}, {"name": "groups created", "value": 0}], "state": "done"}]]}
Expected behavior
The info field shows updated instead of done when the imported value doesn't match with the user's current information. Should return: "email": {"info": "updated", "value": "maxi@example.com"}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the participant.json_upload action and its handle_request path, then trace how referenced participant fields are compared and how each entry's info value is assigned. Reproduce the import with changed participant data and add or update a regression test for the preview response. Done means differing imported values return info "updated" while unchanged values remain "done".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100