From be6a50468de6351593ffbf1c91d545174839ddb5 Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 18 Apr 2024 21:59:17 +0300 Subject: [PATCH] New --- .../__pycache__/views.cpython-310.pyc | Bin 15121 -> 15141 bytes ...sent.html => email_confirmation_sent.html} | 0 osinaweb/osinacore/views.py | 12 ++++++------ 3 files changed, 6 insertions(+), 6 deletions(-) rename osinaweb/osinacore/templates/{email-confirmation-sent.html => email_confirmation_sent.html} (100%) diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index ae39d662ee4ca4085d5a478c45121c25cd225b7a..8517f424c7f6ff215e687235842bd8a78fe16b54 100644 GIT binary patch delta 2457 zcmZ{ld2o|e5Ww@&G)T4-{b;0fcb42}ix3WAg1B4iPw@T)Pv>S7antCZR~q?t=- zf~lrstObUf53>f0l@9&-v|*VjnJ1IMYlJ0)-h`#FG&3y)Q2d!5mx0An&6;7ptG9K)~yNU7K4L{>9Eb_(bkhe17Q|q zW)^2tNUkS{mft%Zb_A;IHcKgPFPe(R8l_3;N>I@jReYOh&(X{>9E8bUkUQ^oG_j>T zdi-C{w#!9t$Hj3Jm5T23Z^Z2Y_Ao|EaEuu#YSxbN2CHX2>5qi@z3W~`NyJQ4@=Qe5 zPcTV3ta0SB9W;gHROtS~XVjCr9Y`w{gQr1Xkioy~T!{kUvn`=Ec$B+J{hba!{ZBE{Fj_T3z_ z`b&B|Kn@xEP{bDF#h{5w-ax<;^zn~TSDy_BO=jqwo6o+1ISw04$+fdC7+q+EWx0>* zwo(K-mYbD)E1b(Mx86Q6n-k@Uen%$4?gx=LoabV33}CYz#1*%?oPSFehX~?;e~(gq z9;Qu$6M1I!VOlr>Mpqi>^7Glz*pPfJ8$~{DR;i7IgCWV|k-X98@wI*#weh5yV5m;= zN8?FRe^of-i}FPjVk2P_xh3FM=enoj?RLUl&Q?NEL0|iE@>F{x5r4=hx6F9=_90L( z*h$g(F@ms8k;0O<+9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(L@*32%1YxWzC^8go7>f(i)Gt^Elv8z)Ddxx$h zSMM$1Li8q*!d>HWhG&)2Zdj82xS7wugNGX;MWGG$wHssq!DDN3%;Xy67Fb=TH;sM|&7(xKJ+w*=s@g1;HyS=B6cJ8AUY8T5O~MZLx`h@ nF~^W65N8k);sW9l;ws`A0{uJf()K diff --git a/osinaweb/osinacore/templates/email-confirmation-sent.html b/osinaweb/osinacore/templates/email_confirmation_sent.html similarity index 100% rename from osinaweb/osinacore/templates/email-confirmation-sent.html rename to osinaweb/osinacore/templates/email_confirmation_sent.html diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 094e0667..185d1791 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -66,7 +66,7 @@ def confirmation_sent(request, *args, **kwargs): context = { } - return render(request, 'email-confirmation-sent.html', context) + return render(request, 'email_confirmation_sent.html', context) def signup(request): @@ -102,10 +102,10 @@ def signup(request): message = render_to_string('email_templates/account_activation_email.html', { 'user': user, 'domain': current_site.domain, - 'uid': urlsafe_base64_encode(force_bytes(user.pk)), + 'uid': urlsafe_base64_encode(force_bytes(user.pk)), #Encode the user id 'token': token, }) - send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email]) + send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email], html_message=message) return redirect('activation_sent') @@ -126,12 +126,12 @@ def signup(request): def activate(request, uidb64, token): try: - uid = str(urlsafe_base64_decode(uidb64), 'utf-8') - user = User.objects.get(pk=uid) + uid = str(urlsafe_base64_decode(uidb64), 'utf-8') #Decoding the user id which was encoded in uid + user = User.objects.get(pk=uid) #Get the user based on uid which is now the id since it was decoded in the previous line of code except (TypeError, ValueError, OverflowError, User.DoesNotExist): user = None - if user is not None and default_token_generator.check_token(user, token): + if user is not None and default_token_generator.check_token(user, token): #Check token for further security profile = CustomerProfile.objects.get(user=user) profile.status = 'Active' profile.save()