fix updating a collection if you don't have access to all the cases

This commit is contained in:
Ross
2024-04-10 23:24:41 +01:00
parent e8f862c7bd
commit dff4705d72
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -464,10 +464,10 @@ class CaseSeriesForm(ModelForm):
class CaseCollectionCaseForm(ModelForm):
def __init__(self, *args, user, **kwargs):
def __init__(self, *args, user, collection, **kwargs):
super(CaseCollectionCaseForm, self).__init__(*args, **kwargs)
queryset = get_cases_available_to_user(user)
queryset = get_cases_available_to_user(user, collection=collection)
self.fields["case"] = ModelChoiceField(
required=False,