mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-16 04:53:11 +00:00
Added verified icon for email
This commit is contained in:
parent
bb994fbe1f
commit
7708b7ccb1
@ -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>
|
||||
|
@ -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')
|
||||
|
BIN
src/static/icons/verified.png
Normal file
BIN
src/static/icons/verified.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Loading…
x
Reference in New Issue
Block a user