Skip to content
Snippets Groups Projects
Commit 686c1c02 authored by Todd Dembrey's avatar Todd Dembrey Committed by Fredrik Jonsson
Browse files

Reduce actions on skipped reports

parent 79dbc108
No related branches found
No related tags found
No related merge requests found
......@@ -773,7 +773,7 @@ class Report(models.Model):
@property
def can_submit(self):
return self.start_date <= timezone.now().date()
return self.start_date <= timezone.now().date() and not self.skipped
@property
def submitted_date(self):
......
......@@ -76,11 +76,14 @@
<span class="data-block__mobile-label">Privacy: </span>{% if report.public %}Public{% else %}Private{% endif %}
</td>
<td class="data-block__links">
<a class="data-block__action-link" href="{% url "apply:projects:reports:detail" pk=report.pk %}">View</a>
{% if not report.skipped %}
<a class="data-block__action-link" href="{% url "apply:projects:reports:detail" pk=report.pk %}">View</a>
{% if request.user.is_apply_staff %}
<a class="data-block__action-link" href="{% url "apply:projects:reports:edit" pk=report.pk %}">Edit</a>
{% if report.skipped %}
{% if request.user.is_apply_staff %}
<a class="data-block__action-link" href="{% url "apply:projects:reports:edit" pk=report.pk %}">Edit</a>
{% endif %}
{% else %}
{% if request.user.is_apply_staff %}
<form action="{% url "apply:projects:reports:skip" pk=report.pk %}" method="post">
{% csrf_token %}
<input type="submit" value="Unskip" class="btn data-block__action-link"></input>
......
......@@ -47,7 +47,7 @@ class ReportDetailView(ReportAccessMixin, DetailView):
def dispatch(self, *args, **kwargs):
report = self.get_object()
if not report.current and not report.skipped:
if not report.current or report.skipped:
raise Http404
return super().dispatch(*args, **kwargs)
......
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