Answer the question
In order to leave comments, you need to log in
Django how to change email address?
Good afternoon, how to implement a change in the email address, without sending a confirmation, just change it in the database to the old one?
Here is the view code:
@login_required()
def email_change(request, user_id):
title = 'Смена электронного адреса'
user = get_object_or_404(User, id=user_id)
if request.method != 'POST':
form = ChangeEmail()
else:
form = ChangeEmail(request.POST)
if form.is_valid():
user.email = form.cleaned_data['email']
user.save()
return HttpResponseRedirect(reverse('users:user', user.id))
context = {'title': title, 'user': user, 'form': form}
return render(request, 'users/email_change_form.html', context)
Answer the question
In order to leave comments, you need to log in
It seems that this error occurs at the time of rendering or preparing the page to which you are redirecting .... Look carefully at the template and the view for the occurrence of 'ru-Ru'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question