Skip to content

Commit

Permalink
Merge pull request #450 from uclouvain/qa
Browse files Browse the repository at this point in the history
[MASTER] RELEASE
  • Loading branch information
BenJneB authored Nov 12, 2024
2 parents 9cbd592 + fd14f01 commit 42cf51d
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 144 deletions.
5 changes: 4 additions & 1 deletion business/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ def _assign_regular_students(assignment, internship):
def _assign_student(assignment, student, internship):
assignment.count += 1
""" Assign offer to student for specific internship."""
choices = assignment.choices.filter(student=student, internship=internship).order_by("choice")
if isinstance(internship, Iterable):
choices = assignment.choices.filter(student=student, internship__in=internship).order_by("choice")
else:
choices = assignment.choices.filter(student=student, internship=internship).order_by("choice")

affectations = None

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pendulum==2.1.2
pendulum==3.0.0
4 changes: 2 additions & 2 deletions tests/views/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def setUp(self):
def test_get_object_list_with_default_paginator_size(self):
objects = [{} for _ in range(0, OBJECTS_LIST_SIZE)]
request = RequestFactory().get('/')
SessionMiddleware().process_request(request)
SessionMiddleware(lambda: None).process_request(request)
self.assertEqual(len(get_object_list(request, objects)), PAGINATOR_SIZE_LIST[0])

def test_get_object_list_with_paginator_size_query_param(self):
objects = [{} for _ in range(0, OBJECTS_LIST_SIZE)]
request = RequestFactory().get('/?paginator_size={}'.format(TEST_PAGINATOR_SIZE))
SessionMiddleware().process_request(request)
SessionMiddleware(lambda: None).process_request(request)
self.assertEqual(len(get_object_list(request, objects)), TEST_PAGINATOR_SIZE)
self.assertEqual(request.session['paginator_size'], {request.path: str(TEST_PAGINATOR_SIZE)})
Loading

0 comments on commit 42cf51d

Please sign in to comment.