Skip to content

Commit

Permalink
Adds previous credential applications to admin user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Mc committed Feb 8, 2021
1 parent 2f1fcba commit fa78f36
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
24 changes: 24 additions & 0 deletions physionet-django/console/templates/console/user_management.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,29 @@ <h3>{{ status }} projects</h3>
</ul>
{% endfor %}

<br />
{% for status, group in cred_apps.items %}
<h3>{{ status }} credential applications</h3>
<ul>
{% for application in group %}
{% if status == "Successful" %}
<li>
<h2>Application Date: {{ application.application_datetime|date }}</h2>
{% include "user/application_display_table.html" %}
<br>
</li>
{% elif status == "Unsuccessful" %}
<li>
<h2>Application Date: {{ application.application_datetime|date }}</h2>
{% include "user/application_display_table.html" %}
<br>
</li>
{% endif %}
{% empty %}
<li>None.</li>
{% endfor %}
</ul>
{% endfor %}

</div>
{% endblock %}
8 changes: 7 additions & 1 deletion physionet-django/console/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,17 @@ def user_management(request, username):
projects['Archived'] = ArchivedProject.objects.filter(authors__user=user).order_by('-archive_datetime')
projects['Published'] = PublishedProject.objects.filter(authors__user=user).order_by('-publish_datetime')

cred_apps = {}
cred_apps['Successful'] = CredentialApplication.objects.filter(user=user, status=2
).order_by('-decision_datetime')
cred_apps['Unsuccessful'] = CredentialApplication.objects.filter(user=user,
status__in=[1, 3, 4]).order_by('-decision_datetime')

return render(request, 'console/user_management.html', {'subject': user,
'profile': user.profile,
'emails': emails,
'projects': projects})
'projects': projects,
'cred_apps': cred_apps})


@login_required
Expand Down

0 comments on commit fa78f36

Please sign in to comment.