diff --git a/taskapp/models.py b/taskapp/models.py
index 4c5373d..b755fca 100644
--- a/taskapp/models.py
+++ b/taskapp/models.py
@@ -101,6 +101,9 @@ class Task(models.Model):
def get_attachment_fname(self):
return os.path.basename(self.attachment.name)
+ def is_outdated(self):
+ return self.out_date < timezone.now().date()
+
def task_handler(sender, instance, **kwargs):
group = ''
diff --git a/taskapp/templates/taskapp/tasklist_all.html b/taskapp/templates/taskapp/tasklist_all.html
index 4ed5c92..ce4209c 100644
--- a/taskapp/templates/taskapp/tasklist_all.html
+++ b/taskapp/templates/taskapp/tasklist_all.html
@@ -32,7 +32,7 @@
{% for task in tasks %}
- {% if task.out_date > current_date %}
+ {% if task.is_outdated %}
{% else %}
{% if task.priority == 'E' %}
diff --git a/taskapp/views.py b/taskapp/views.py
index 495ebbb..8200cf5 100644
--- a/taskapp/views.py
+++ b/taskapp/views.py
@@ -5,7 +5,6 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from abonapp.models import Abon
from django.utils.translation import ugettext as _
-from django.utils import timezone
from datetime import date
from .models import Task
from mydefs import pag_mn, only_admins, safe_int, MultipleException
@@ -68,8 +67,7 @@ def all_tasks(request):
tasks = Task.objects.all()
tasks = pag_mn(request, tasks)
return render(request, 'taskapp/tasklist_all.html', {
- 'tasks': tasks,
- 'current_date': timezone.now()
+ 'tasks': tasks
})