SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit aa8e34c8 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Debug display of fellowship type in detail; accelerate with prefetch

parent 477f5bce
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,15 @@
</tr>
<tr>
<th>Type</th>
<td>{{ fellowship.guest|yesno:"Guest fellowship,Regular fellowship"|safe }}</td>
<td>
{% if fellowship.guest %}
<span class="text-warning">Guest</span>
{% elif fellowship.senior %}
<span class="text-success">Senior</span>
{% else %}
<span class="text-primary">Regular</span>
{% endif %}
` </td>
</tr>
</tbody>
</table>
......@@ -87,7 +95,15 @@
{% for fship in fellowship.sibling_fellowships %}
<tr>
<td>{{ fship.id }}</td>
<td>{{ fship.guest|yesno:"Guest fellowship,Regular fellowship"|safe }}</td>
<td>
{% if fship.guest %}
<span class="text-warning">Guest</span>
{% elif fship.senior %}
<span class="text-success">Senior</span>
{% else %}
<span class="text-primary">Regular</span>
{% endif %}
</td>
<td>
{% if fship.start_date %}
from {{ fship.start_date }}
......
......@@ -201,6 +201,13 @@ class FellowshipDetailView(PermissionsMixin, DetailView):
permission_required = "scipost.can_manage_college_composition"
model = Fellowship
def get_queryset(self):
queryset = Fellowship.objects.all().prefetch_related(
"pool__preprint",
"pool__editor_in_charge",
)
return queryset
class FellowshipListView(PermissionsMixin, PaginationMixin, ListView):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment