Skip to content

Commit

Permalink
Fixes #1948: Fix TypeError when attempting to add a member to an exis…
Browse files Browse the repository at this point in the history
…ting virtual chassis
  • Loading branch information
jeremystretch committed Mar 6, 2018
1 parent c823660 commit 603b80d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ def post(self, request, pk):
device = member_select_form.cleaned_data['device']
device.virtual_chassis = virtual_chassis
data = {k: request.POST[k] for k in ['vc_position', 'vc_priority']}
membership_form = forms.DeviceVCMembershipForm(data, validate_vc_position=True, instance=device)
membership_form = forms.DeviceVCMembershipForm(data=data, validate_vc_position=True, instance=device)

if membership_form.is_valid():

Expand All @@ -2242,7 +2242,7 @@ def post(self, request, pk):

else:

membership_form = forms.DeviceVCMembershipForm(request.POST)
membership_form = forms.DeviceVCMembershipForm(data=request.POST)

return render(request, 'dcim/virtualchassis_add_member.html', {
'virtual_chassis': virtual_chassis,
Expand Down

0 comments on commit 603b80d

Please sign in to comment.