Skip to content

Commit ac68bb3

Browse files
author
Nik Sauer
committed
UserDeviceForm select only the devices with current campaing = this campaign
1 parent e741536 commit ac68bb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/campaign/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def __init__(self, *args, **kwargs):
169169

170170
# query set should be a list of all devices in the same organisation as the campaign is
171171
self.fields['current_devices'].queryset = self.campaign.organization.current_devices.all()
172-
self.initial['current_devices'] = self.user.current_devices.all()
172+
self.initial['current_devices'] = self.user.current_devices.filter(current_campaign = self.campaign).all()
173173

174174
# Initialize form helper
175175
self.helper = FormHelper(self)

0 commit comments

Comments
 (0)