From fa78f36ebae3d8576cba5e8133a52d5b33c93bae Mon Sep 17 00:00:00 2001 From: Lucas McCullum Date: Mon, 8 Feb 2021 15:38:55 -0500 Subject: [PATCH] Adds previous credential applications to admin user profile --- .../templates/console/user_management.html | 24 +++++++++++++++++++ physionet-django/console/views.py | 8 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/physionet-django/console/templates/console/user_management.html b/physionet-django/console/templates/console/user_management.html index 4555a8e9d7..3f16ba8ff5 100644 --- a/physionet-django/console/templates/console/user_management.html +++ b/physionet-django/console/templates/console/user_management.html @@ -91,5 +91,29 @@

{{ status }} projects

{% endfor %} +
+ {% for status, group in cred_apps.items %} +

{{ status }} credential applications

+ + {% endfor %} + {% endblock %} diff --git a/physionet-django/console/views.py b/physionet-django/console/views.py index 7e2da93673..60e5ed1bb8 100644 --- a/physionet-django/console/views.py +++ b/physionet-django/console/views.py @@ -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