Skip to content

Commit

Permalink
active user emails
Browse files Browse the repository at this point in the history
  • Loading branch information
DuP-491 committed Feb 3, 2022
1 parent fbd14f9 commit 0b32c3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions news/templates/news/notice.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@


{% block body %}
<div id="message_container">
{% include 'spinnets/message.html' %}
</div>
{#<div id="message_container">#}
{# {% include 'spinnets/message.html' %}#}
{#</div>#}
<section id="notice">
<div class="d-flex justify-content-center my-3">
<h2 class="">NOTICE BOARD</h2>
Expand Down
5 changes: 3 additions & 2 deletions news/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def broadCastNews(request,pk):
to_users = []
for user in User.objects.all():
try:
to_users.append(user.email)
if user.is_active and user.email is not EMAIL_HOST_USER:
to_users.append(user.email)
except:
pass
try:
Expand All @@ -56,7 +57,7 @@ def broadCastNews(request,pk):
email.send()
except:
pass
messages.success(request, f'Notice has been broadcasted to all users')
messages.success(request, f'Notice has been broadcast to all users')
return redirect('news:news_page')

@has_role_head_or_coordinator
Expand Down

0 comments on commit 0b32c3c

Please sign in to comment.