From 4c7f5e6d2b48242e8c3cc97e30df9a8506b9e333 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 16 May 2017 17:56:40 +0530 Subject: Change forms.py, views.py, send_emails.py, models.py - Alter activation_key field in Profile model - Change get_activation_key function in send_mail to create secret_key of fixed length - Change forms.py to get updated activation_key - Change views.py to save activation_key --- yaksh/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'yaksh/views.py') diff --git a/yaksh/views.py b/yaksh/views.py index c7af5cc..7db0366 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -1543,7 +1543,10 @@ def new_activation(request, email=None): user.profile.key_expiry_time = timezone.now() + \ timezone.timedelta(minutes=20) user.profile.save() - success, msg = send_user_mail(user.email, user.profile.activation_key) + new_user_data = User.objects.get(email=email) + success, msg = send_user_mail(new_user_data.email, + new_user_data.profile.activation_key + ) if success: context['activation_msg'] = msg else: @@ -1555,6 +1558,8 @@ def new_activation(request, email=None): context_instance=ci) def update_email(request): + context = {} + ci = RequestContext(request) if request.method == "POST": email = request.POST.get('email') username = request.POST.get('username') -- cgit