Commit 6881b662 authored by David Haynes's avatar David Haynes
Browse files

Merge remote-tracking branch 'origin/2.2-dev' into 40-python3port

parents 78becf69 744837fe
......@@ -25,7 +25,7 @@ SRCT Go • Administration Panel
</div>
<!-- TABLE 1 -->
<!-- Table 1 -->
<!-- define the div where we can select users from a table to judge them -->
<div class="row">
<div class="col-md-12">
......@@ -80,9 +80,8 @@ SRCT Go &bull; Administration Panel
</div>
</div>
<!-- TABLE 2 -->
<!-- define the table that displays blocked users and allows us to unblock
them -->
<!-- Table 2 -->
<!-- define the table that displays blocked users and allows us to unblock them -->
<div class="row">
<div class="col-md-12">
<h3>Blocked Users</h3>
......@@ -99,6 +98,7 @@ them -->
<th>Username</th>
<th>Full Name</th>
<th>Description</th>
<th>Approved</th>
</tr>
</thead>
......@@ -111,6 +111,7 @@ them -->
<td>{{ blockedUsers.user }}</td>
<td>{{ blockedUsers.full_name }}</td>
<td>{{ blockedUsers.description|default:"No description provided" }}</td>
<td>{{ blockedUsers.approved }}</td>
</tr>
<!-- unless there are no blocked users -->
{% empty %}
......@@ -119,6 +120,7 @@ them -->
<td>none</td>
<td>none</td>
<td>none</td>
<td>none</td>
</tr>
{% endfor %}
</tbody>
......@@ -132,7 +134,7 @@ them -->
</div>
</div>
<!-- TABLE 3 -->
<!-- Table 3 -->
<!-- define the table of current users -->
<div class="row">
<div class="col-md-12">
......
......@@ -104,7 +104,7 @@ SRCT Go &bull; About
Go 1.0:
<br />
<a href="https://github.com/jrouly">Michel Rouley</a>,
<a href="https://github.com/creffett">Chris Reffet</a>,
<a href="https://github.com/creffett">Chris Reffett</a>,
<a href="https://github.com/nanderson94">Nicholas Anderson</a>,
and <a href="https://github.com/akshaykarthik">Akshay Karthik</a>.
<br></br>
......
......@@ -22,6 +22,9 @@ SRCT Go &bull; My Links
</strong></h1>
</div>
</div>
<div class="newlink" style="text-align: right;">
<a href="{% url 'index' %}"><i class="fa fa-plus" aria-hidden="true"></i> Add new link</a>
</div>
</div>
<!-- show all of the links -->
......
......@@ -340,13 +340,13 @@ def useradmin(request):
settings.EMAIL_FROM,
[user_mail]
)
# If we're denying users
elif '_deny' in request.POST:
for name in userlist:
toDeny = RegisteredUser.objects.get(user__username__exact=name)
if settings.EMAIL_HOST and settings.EMAIL_PORT:
user_mail = toDeny.user.username + settings.EMAIL_DOMAIN
# Send an email letting them know they are denied
send_mail(
'Your Account has been Denied!',
......@@ -365,6 +365,7 @@ def useradmin(request):
# Delete their associated RegisteredUsers
toDeny.user.delete()
return HttpResponseRedirect('useradmin')
# If we're blocking users
elif '_block' in request.POST:
for name in userlist:
......@@ -387,9 +388,8 @@ def useradmin(request):
)
# toBlock.user.delete()
toBlock.blocked = True
toBlock.approved = False
toBlock.registered = False
toBlock.save()
# If we're un-blocking users
elif '_unblock' in request.POST:
for name in userlist:
......@@ -436,10 +436,12 @@ def useradmin(request):
)
toRemove.user.delete()
return HttpResponseRedirect('useradmin')
# Get a list of all RegisteredUsers that need to be approved
need_approval = RegisteredUser.objects.filter(registered=True).filter(approved=False)
# Get a list of all RegisteredUsers that need to be approved
need_approval = RegisteredUser.objects.filter(registered=True).filter(approved=False).filter(blocked=False)
# Get a list of all RegisteredUsers that are currently users
current_users = RegisteredUser.objects.filter(approved=True).filter(registered=True).filter(blocked=False)
# Get a list of all RegisteredUsers that are blocked
blocked_users = RegisteredUser.objects.filter(blocked=True)
# Pass that list to the template
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment