aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-02-28 23:10:56 +0200
committerFilipp Lepalaan <filipp@mac.com>2016-02-28 23:10:56 +0200
commitf3cd067dd262dd0a6384a2122375dc3f10e3ebcf (patch)
treed3b0333a20fa1daaa7c42ebb8bbbf62cc3bacaf5 /servo
parentcd690e453e1421a54efdcbaf6b0d18f45eed56cc (diff)
downloadServo-f3cd067dd262dd0a6384a2122375dc3f10e3ebcf.tar.gz
Servo-f3cd067dd262dd0a6384a2122375dc3f10e3ebcf.tar.bz2
Servo-f3cd067dd262dd0a6384a2122375dc3f10e3ebcf.zip
Set ActiveManager as default
Diffstat (limited to 'servo')
-rw-r--r--servo/models/order.py3
-rw-r--r--servo/models/repair.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/servo/models/order.py b/servo/models/order.py
index c7fb594..aad1932 100644
--- a/servo/models/order.py
+++ b/servo/models/order.py
@@ -367,6 +367,9 @@ class Order(models.Model):
self.set_status(self.queue.status_closed, user)
def reopen(self, user):
+ """
+ Re-opens this service order
+ """
self.state = Order.STATE_OPEN
self.closed_at = None
self.save()
diff --git a/servo/models/repair.py b/servo/models/repair.py
index c9bb952..ba52980 100644
--- a/servo/models/repair.py
+++ b/servo/models/repair.py
@@ -89,7 +89,7 @@ class ActiveManager(models.Manager):
GSX repairs that have been submitted, and not marked complete
"""
use_for_related_fields = True
-
+
def active(self, **kwargs):
return self.filter(completed_at=None, **kwargs).exclude(submitted_at=None)
@@ -198,8 +198,7 @@ class Repair(models.Model):
symptom_code = models.CharField(max_length=7, default='')
issue_code = models.CharField(max_length=7, default='')
- objects = models.Manager()
- active = ActiveManager()
+ objects = ActiveManager()
def is_submitted(self):
return self.submitted_at is not None