aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-11-07 18:43:43 +0200
committerFilipp Lepalaan <filipp@mac.com>2016-11-07 18:43:43 +0200
commit7dbcacd01bec20db3ccb841bec1e8e4268a4b052 (patch)
treeefb19d27b0420ce734e895a48fd5622f77dcc634 /servo/models
parentc087462f4deec9650da7b965ef8ecfb2fece07f3 (diff)
downloadServo-7dbcacd01bec20db3ccb841bec1e8e4268a4b052.tar.gz
Servo-7dbcacd01bec20db3ccb841bec1e8e4268a4b052.tar.bz2
Servo-7dbcacd01bec20db3ccb841bec1e8e4268a4b052.zip
Fixed spurious keyword error
list_orders() got an unexpected keyword argument 'queue'
Diffstat (limited to 'servo/models')
-rw-r--r--servo/models/queue.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/servo/models/queue.py b/servo/models/queue.py
index eb8414e..7650f46 100644
--- a/servo/models/queue.py
+++ b/servo/models/queue.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from datetime import timedelta
-from django.conf import settings
from django.db import models
from django.utils import timezone
@@ -160,7 +159,8 @@ class Queue(models.Model):
return reverse('admin-edit_queue', args=[self.pk])
def get_absolute_url(self):
- return reverse('orders-list_queue', args=[self.pk])
+ p = '?queue=%d' % self.pk
+ return reverse('orders-index') + p
def get_order_count(self, max_state=2):
count = self.order_set.filter(state__lt=max_state).count()
@@ -260,10 +260,12 @@ class QueueStatus(models.Model):
"""
Gets the green time limit for this QS
"""
- return timezone.now() + timedelta(seconds=self.limit_green*self.limit_factor)
+ sec = self.limit_green * self.limit_factor
+ return timezone.now() + timedelta(seconds=sec)
def get_yellow_limit(self):
- return timezone.now() + timedelta(seconds=self.limit_yellow*self.limit_factor)
+ sec = self.limit_yellow * self.limit_factor
+ return timezone.now() + timedelta(seconds=sec)
def __unicode__(self):
return self.status.title