Skip to content

Commit

Permalink
Filter initial user set by user id for deviations
Browse files Browse the repository at this point in the history
Fixes #1238. `UsersSearchSelectField` searches by user id, so the
submitters must be a list of user ids instead of profile ids as one
might expect.
  • Loading branch information
lainets committed Aug 30, 2023
1 parent 426ac58 commit 0494030
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deviations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, *args: Any, initial: Optional[Dict[str, Any]] = None, **kwarg
try:
# Support setting the initial value for submitter
self.fields['submitter'].initial_queryset = (
course_instance.get_student_profiles().filter(id__in=initial.get('submitter'))
course_instance.get_student_profiles().filter(user_id__in=initial.get('submitter'))
)
except (ValueError, TypeError):
pass
Expand Down

0 comments on commit 0494030

Please sign in to comment.