Added verified icon for email

This commit is contained in:
ayxan 2022-12-07 22:01:05 +04:00
parent bb994fbe1f
commit 7708b7ccb1
3 changed files with 22 additions and 15 deletions

View File

@ -9,7 +9,13 @@
<div class="card mb-3">
<div class="card-body">
<h5>Username: <small>{{profile.username}}</small></h5>
<h5>Email: <small>{{profile.email|default:""}}</small></h5>
{% if profile.email_notification_is_active %}
<h5>Email: <small style="margin-right: 0.7%;">{{profile.email|default:""}}</small>
<img src="{% static 'icons/verified.png' %}" alt="{% static 'icons/verified.png' %}" width="22px">
</h5>
{% else %}
<h5>Email: <small>{{profile.email|default:""}}</small></h5>
{% endif %}
<h5>IMDB API Key: <small>{{profile.imdb_api_key}}</small></h5>
</div>
</div>

View File

@ -42,20 +42,21 @@ def profile_editing_view(request):
user.email_notification_is_active = False
user.save()
to_email = form.cleaned_data.get('email')
current_site = get_current_site(request)
mail_subject = 'Activate your account.'
message = render_to_string('acc_active_email.html', {
'user': user,
'domain': current_site.domain,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
email = EmailMessage(
mail_subject, message, to=[to_email]
)
email.send()
messages.warning(request, "Please confirm your email address to receive notifications of new episodes.")
return redirect('homepage')
if to_email is not None:
current_site = get_current_site(request)
mail_subject = 'Activate your account.'
message = render_to_string('acc_active_email.html', {
'user': user,
'domain': current_site.domain,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
email = EmailMessage(
mail_subject, message, to=[to_email]
)
email.send()
messages.warning(request, "Please confirm your email address to receive notifications of new episodes.")
return redirect('homepage')
messages.success(request, 'Profile Updated')
return redirect('homepage')

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB