1๐
I was referencing Member model instead of ActiveMember hopefully this will help someone.
def update(request, id):
member = ActiveMember.objects.get(pk=id)
if request.method == 'POST':
form = ActiveMemberForm(request.POST, instance=member)
if form.is_valid():
# update the existing `Band` in the database
form.save()
# redirect to the detail page of the `Band` we just updated
return render(request, 'members/update.html', {
'form': form,
'success': True,
})
else:
form = ActiveMemberForm(instance=member)
return render(request, 'members/update.html', {
'form': form,
'member': member,
})
๐คwormy505
Source:stackexchange.com