aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-09-22 12:36:35 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-09-22 12:36:35 +0300
commit7b3998614cbc15c753080d3f10a43324eaa02d95 (patch)
tree73d9a12048c863e269c8ff811e9623319930c02e /servo
parentb737857e98ad74d93496d476cd879d833abf6ab3 (diff)
downloadServo-7b3998614cbc15c753080d3f10a43324eaa02d95.tar.gz
Servo-7b3998614cbc15c753080d3f10a43324eaa02d95.tar.bz2
Servo-7b3998614cbc15c753080d3f10a43324eaa02d95.zip
Don't SN update GPR parts
Fixed issue with completing GSX repairs containing GPR-parts.
Diffstat (limited to 'servo')
-rw-r--r--servo/models/parts.py1
-rw-r--r--servo/models/repair.py11
2 files changed, 11 insertions, 1 deletions
diff --git a/servo/models/parts.py b/servo/models/parts.py
index c262175..c7076d8 100644
--- a/servo/models/parts.py
+++ b/servo/models/parts.py
@@ -224,6 +224,7 @@ class ServicePart(models.Model):
def update_part(self, return_data, return_type, user):
"""
gsx/returns/Parts Return Update
+ Updates the GSX status of this part
"""
self.repair.connect_gsx(user)
diff --git a/servo/models/repair.py b/servo/models/repair.py
index 7bf2762..7c9d595 100644
--- a/servo/models/repair.py
+++ b/servo/models/repair.py
@@ -552,6 +552,9 @@ class Repair(models.Model):
pass
def complete(self, user):
+ """
+ Marks this repair as being complete
+ """
self.completed_at = timezone.now()
self.completed_by = user
self.save()
@@ -561,6 +564,12 @@ class Repair(models.Model):
status = queue.status_repair_completed
self.order.set_status(status, user)
+ def get_sn_update_parts(self):
+ """
+ Returns parts eligible for SN update
+ """
+ return self.servicepart_set.exclude(return_code='GPR')
+
def close(self, user):
"""
Marks this GSX repair as complete
@@ -570,7 +579,7 @@ class Repair(models.Model):
try:
# Update part serial numbers
- [part.update_sn() for part in self.servicepart_set.all()]
+ [part.update_sn() for part in self.get_sn_update_parts()]
repair.mark_complete()
except gsxws.GsxError as e:
"""