Commit 1d75656
authored
[BUGFIX] Renamed 'response' to 'existing_response' to avoid variable re-declaring (#5383)
# Description
When checking collisions of responses to avoid duplicate responses given
by the same user to the same question, the response argument is
redeclared and the `response.user_id == response.user_id ` will always
be satisfied, raising an exception.
Closes #5357
**Type of change**
- Bug fix (non-breaking change which fixes an issue)
**How Has This Been Tested**
Changes done locally, installed the local version and tested on top of
our Argilla server with this piece of code (details were obfuscated):
```
for user in client.users:
record_to_add.responses.add(rg.Response("label_name", label, user_id=user.id, status="submitted"))
```1 parent b7ac946 commit 1d75656
File tree
2 files changed
+6
-2
lines changed- argilla-server
- argilla/src/argilla/records
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | | - | |
| 373 | + | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
0 commit comments