SciPost Code Repository

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

Add `Contributor.available_again_after_date` property

parent 3e334a46
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
{{ fellowship.contributor.EIC_in_stage_in_refereeing|length }} {{ fellowship.contributor.EIC_in_stage_in_refereeing|length }}
</td> </td>
{% if fellowship.contributor.current_unavailability_periods %} {% if fellowship.contributor.current_unavailability_periods %}
<td colspan="2"><em class="text-muted">unavailable</em></td> <td colspan="2" class="text-center"><em class="text-muted">unavailable up to {{ fellowship.contributor.available_again_after_date }}</em></td>
{% else %} {% else %}
<td class="text-center">{{ fellowship.nr_visible }}</td> <td class="text-center">{{ fellowship.nr_visible }}</td>
<td class="text-center"> <td class="text-center">
......
...@@ -161,6 +161,12 @@ class Contributor(models.Model): ...@@ -161,6 +161,12 @@ class Contributor(models.Model):
"""Check if Contributor is currently not marked as unavailable.""" """Check if Contributor is currently not marked as unavailable."""
return not self.unavailability_periods.today().exists() return not self.unavailability_periods.today().exists()
@property
def available_again_after_date(self):
unav = self.unavailability_periods.today().first()
if unav:
return unav.end
@property @property
def is_scipost_admin(self): def is_scipost_admin(self):
"""Check if Contributor is a SciPost Administrator.""" """Check if Contributor is a SciPost Administrator."""
......
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