я получаю typeError: is_valid () отсутствует 1 обязательный позиционный аргумент: 'self'
пожалуйста, исправьте, где я сделал ошибку
def register(request):
registered = False
if request.method == "POST":
user_form = UserForm(request.POST)
profile_form = UserProfileInfoForm(request.POST, request.FILES)
if user_form.is_valid() and UserProfileInfoForm.is_valid():
user = user_form.save()
user.set_password(user.password)
user.save()
profile = profile_form.save(commit=False)
profile.user = user
if 'profile_pic' in request.FILES:
profile.profile_pic = request.FILES['profile_pic']
profile.save()
registered = True
else:
print(user_form.errors, profile_form.errors)
else:
user_form = UserForm()
profile_form = UserProfileInfoForm()
return render(request, 'basic_app/registration.html',
{'user_form': user_form, 'profile_form': profile_form, 'registered': registered})