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 12, 2021
1 parent efa4fcb commit 57a1873
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{# Status section #}

<p>Username: <a href="{% url 'user_management' application.user.username %}">{{ application.user.username }}</a></br>
Applied: {{ application.application_datetime|date }}</br>
Applied: {{ application.application_datetime|date }}</br>
[<a href="{% url 'user_credential_applications' application.user %}" target="_blank">View previous applications.</a>]</br>
[<a href="https://www.google.com/search?q={{ application.first_names }} {{ application.last_name }} {{ application.organization_name }}" target="_blank">Search for name and affiliation.</a>]</p>

{% if application.reference_contact_datetime %}
Expand Down
1 change: 0 additions & 1 deletion physionet-django/console/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,6 @@ 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')


return render(request, 'console/user_management.html', {'subject': user,
'profile': user.profile,
'emails': emails,
Expand Down
2 changes: 2 additions & 0 deletions physionet-django/user/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
path('settings/credentialing/', views.edit_credentialing, name='edit_credentialing'),
path('settings/credentialing/applications/',
views.user_credential_applications, name='user_credential_applications'),
path('settings/credentialing/applications/<user>/',
views.user_credential_applications, name='user_credential_applications'),
path('settings/agreements/', views.view_agreements, name='edit_agreements'),
path('settings/agreements/<id>/',
views.view_signed_agreement, name='view_signed_agreement'),
Expand Down
8 changes: 6 additions & 2 deletions physionet-django/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,16 @@ def edit_credentialing(request):


@login_required
def user_credential_applications(request):
def user_credential_applications(request, user=None):
"""
All the credential applications made by a user
"""
if user:
request_user = User.objects.filter(username=user)[0]
else:
request_user = request.user
applications = CredentialApplication.objects.filter(
user=request.user).order_by('-application_datetime')
user=request_user).order_by('-application_datetime')

return render(request, 'user/user_credential_applications.html',
{'applications':applications})
Expand Down

0 comments on commit 57a1873

Please sign in to comment.